i've got 2 forms, login form and main form. the user types his name in the textbox. i wan to store that name in a string variable and then use it to set a label in the main form? how will i get by doing this, help is much appreciated
Get and Set Method
Collapse
X
-
On the click event to go into the main form have a string to get the name out of the textbox on the login form. When you call the main form, pass in the string with the name.
string username = txtUsername.Tex t;
FormMain frmMain = new FormMain(userna me);
public FormMain(string nameIn)
{
lblShowName.Tex t = nameIn;
}
Comment