I have a form that has been loaded and I click on a quit link to terminate my app but then I display a messageBox to ask the user if they want to save a file before quitting. When the messageBox pops up, another new instance of this form displays. What causes this and how can I prevent it?
I have a non form class. I want to update label/ check status of check box etc.. in non form class ( here resides functions that contains logic). How can i do that ?
I am trying to create a windows form that acts like a windows taskbar. So i found this on the web Link so i have tried using it.
But when i try and edit the form in the form designer in visual studio none of the changes i have made appear when i debug the form. It just appears as a blank grey box at the top of my screen. What am i doing wrong?
Create a program that will let the user input an amount in the form (367). The Program should determine the no. of coins for each dominations : 50,25,10,5,1. (using Turbo C)
My question is are there various ways that I can approach this program. I.e. do I have to use switch statements?
/* NumToTxt Creates the appropriate word form of any positive integer up to 999999 */
#include <iostream> using namespace std; //represents the largest array size for the user entered number const int MAXNUMARRAY = 6; /*represents the largest number that can be entered + 1. Used to calculate the first number used to truncate the user entered number and to display an error message to the user that tells the user the largest number that the program will accept. */ const int BIGGESTNUMBER = 1000000;
I am wanting to separate the logic from the visual, but I'm having problems when calling the method that controls the actions of the progress bar timer.
Error1error C2182: 'set_Progress' : illegal use of type 'void'h:cry_devprogrammingc++school_mediaschool_mediaForm1.h277 Error2error C2078: too many initializersh:cry_devprogrammingc++school_mediaschool_mediaForm1.h277 Error3error C2440: 'initializing' : cannot convert from 'System::Windows::Forms::Timer ^' to 'int'h:cry_devprogrammingc++school_mediaschool_mediaForm1.h277
There is function written C++, that must be compiled to DLL. This DLL is linked to some CAD (computer aded design) tool, that has special interface for it.
I want to add to this function some GUI (graphical user interface). So the creation of a window is necessary.
I've tried already with Win32, but without success.
The problem is that CreateWindow function requires application instance handle, that is provided by Windows itself when window is created in "normal conditions".
I'm writing code to create an array of integer and let user input choice to display, replace, add new element, etc.I created a header file in the header file there's a function:
Code:
int display_one_element(int* array, int num_of_elements, int position) { if(num_of_elements < position || position < 0) { printf("Position out of bound. "); return 1; } return array[position-1]; }
My code seems to work fine but there's an error message right next to my function call: 1.too many arguments provided to function like macro invocation 2.Expression result unused
I tried to move the function from header file to c source file. but other functions in the header file works fine and this doesn't work with the error message.
when user chick first radio button a message1 will show with OK button when user chick second radio button an another message2 will show with OK button
But its didn't work like this. its work like:
1- user chick first radio button 2- message1 will show with OK button 3- user click OK 4- user chick second radio button 5- message1 will show again with OK button 6- user click OK 7- then message2 will show again with OK button
so when user click in second time its show the 2 message the message1 then the message2
This is more of a Application Design question, Let's say I have Form1(Login), this is opened from Program.cs, when the user enters details, the Event Handler makes a instance of a class, adds the data and stores the instance within Program.cs class.
So the best thing to do here, is to close the Form1(Login) and open Form2(Main) via Program.cs so that I can send the List<Login> object with my Login instance objects to said form. This form will remain open throughout the applications use as it's like the main GUI for all the programs functions.
When I close this form, I may want to save some information before the application is terminated, so I may as well store the Login instances in Program.cs anyway.
Main stepping stone: Multiple (usually around 3 max) users can login this system if need be, which will mean closing Form2(Main) and then opening Form1(Login) so that once Form1 is closed it can recreate the From2(Main) form and pass the new List<Login> to that form.
What's the best way to do this, at the moment i'm creating the Form2 instance like so:
//.... //Detect the Login form being closed loginForm.Closed += new EventHandler(OnLoginClosed); //... //Open the main form when the login is closed private void OnLoginClosed(object sender, EventArgs e)
[Code] .....
This seems like it will work and do the job, but is there a better and cleaner way? The List<Login> will be passed to Forms which are created via Form2(Main) as this information will be needed. It's just that ive been told not to use Forms for too much data containment.
I have a form with 2 text boxes (Email and Password)
The user fills in the text boxes and clicks on the Log in button. The code behind the log in button does the following, First connects to a table (Users) in phpmyadmin. Next runs a SQL query (SELECT * FROM `users` WHERE Email = '" + sEmail + "' AND Password = '" + sPassword + "'") sEmail being the variable created from the text entered in Email text box and the same for password.
Next if the record count == to 1 it opens up the main menu form and if the record count == 0 it fails and the user does not get to the main menu.
All of the above is fine and working however what I want to do is take over a variable from the log in form to the other forms.
The code is below for the sign in button as all my code is behind that (I think this may be where I'm going wrong).
public partial class WelcomeForm : Form{ public static string connStr = "server = localhost; " + "database = ppw5; " + "uid = James; " + "pwd = buster;";
[Code] .....
And the Main menu form where I'd like to take a variable over with me, lets assume the variable is the UserID from the database table that I pull from the dTable I created.
public partial class MenuForm : Form { //Call the CloseProgram class and create a new method called ClassClose. CloseProgram ClassClose = new CloseProgram(); WelcomeForm User = new WelcomeForm(); public MenuForm() { InitializeComponent();
I have a program which when a button is clicked on Form1 it runs a vision system operation on an image in a window on a Form1. There are also other buttons on the Form1 which can change things like threshold levels so the inspection can be run again with different settings. It all works fine but I want to change it to remove the buttons from Form1 so that when the user clicks on a button on Form1 it opens up another form, Form2, and all the buttons which were on Form1 are now on Form2 and the image analysis should run on Form1 when the buttons are used on Form2. I have taken over all the code from Form1 to Form2 and I'm trying to make this happen by creating a new oject on Form1 which calls a method on Form2 which contains the code which was in Form1 and called when the button was clicked on Form1 - not working!! I have a constructor in Form2 but I think I have become monumentally confused.
This was the code which was on Form1 when the inspection button was clicked.
I have 3 Windows Form: frmMain, frmFirstForm, and frmSecondForm.
frmMain is the form that will load when the application is started with 2 tabs to access frmFirstForm and frmSecondForm.
Here's my problem:
After making a selection from a combobox on frmFirstForm, I would like a datagridview header to change based on the selection made. Here is a list of items on one combobox: Item1, Item2, Item3, Item4. When somebody chooses Item one, the header on the datagridview on frmSecondForm should display: JohnItem1, PaulItem1, BradItem1 and so on. Those items are not part of the comboboxes, but they will be shown as header text on the datagridview on the second form either automatically or after clicking OK from frmMain. There's no OK button on frmFirstForm, but on frmMain.
The only code I have right now is the if statement on the form load on frmSecondForm. Here's what I have:
private void HeaderTextLoad() { if(comboboxonfirstform.text = "Item1") { datagridview1.Columns[0].HeaderText = "ItemJohn"; datagridview1.Columns[1].HeaderText = "ItemPaul"; ... And so on. } }
First index of the second line tells the number of non-zero entries of the first row and second index tell the column number where the non zero entry is placed
I have a struct called Array and I'm to create a function to create a dynamic array that's fill with randomly generated integers from 0 to 50 (inclusive) and a function to destroy the array for freeing its memory. Below the code that I have written so far.
Code:
* Struct */ typedef struct {int *pArray; //the dynamic array int length; //the size of the dynamic array}Array; /* Function to create a dynamic array */ Array *initializeArray (int length) {int i; }
I need to create a project that create a automated backup of a file.
i will get the file from C:/Folder/file.exe and move for a other created folder, but.. in every time that user make this backup, a folder will be created with year, month and date, like: C/Folder2/2014/April/16:42/file.exe.
I have a gridview setup. It adds data into it no problem, but if I try and see it on the screen nothing appears?
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Data.Linq; namespace FinalProject{ public partial class WebForm1 : System.Web.UI.Page
I need writing a program in c++ that will get the input of 50 different users for the following the fields (surname, other names, sex, status, date of birth) and after entering the data for these 50 users, it will then output only the list of all FEMALE users who were registered...
#include <iostream> #include <string> using namespace std; int main () { string surname, other_names1, other_names2, status, sex, dob;
[Code] ....
I don't really know what to do next - all my attempts have not really given me the result I want.
I want to update a label from Form2. When I click on the button on Form 2, the textbox on Form2 should update the label on Form1 and take me to a certain website. What ever URL is typed into the textbox on Form2 is what website URL the label on Form1 will take me to. The label on Form1 can say something such as You can check out my website here!!! and when they click on the saying it takes me to their website.
I have a label on my main form. When I menu select my settings form, I make a change to the label text on the main form but the label text does not update with the new text.
So here is my code in my settings form:
MainForm frm = new MainForm(); frm.paintMainFormThemeTitle(logoText); // updates the main form label
I may not fully understand the new instantiate key word, but doesn't this create another, new copy of my main form to operate on? And isn't that why I can't see my label text change on my main form that is previously in view?
All of the examples that I have been able to find show using this new key word to be able to access a component on another form. But to my understanding, I'm creating another, new form.