I have a login screen and I need to pass username to my main form (for getting permissions etc.). Here is my code:
//Login
private void button1_Click(object send
This is the best way to transfer data from one form to another, On the LoginForm.cs write like this:
ex.UserName = txtUserName.text;
Password=txtPassword.text;
MainForm mainForm = new MainForm(UserName,Password);
this.Hide();
mainForm.Show();
In the MainForm.cs edit the
public MainForm () { }
like this:
public MainForm(string userName,string password){
}