As you have not described your problem correctly, I came to this conclusion from your subject that you're passing the data between forms.
Regardless of your problem, there are
2 ways of doing that
(basics of C#):
1.) Pass the values through
constructor
2.) Make a
property
(get; set;) and call that by instance of the particular form
Here I'm showing you how to pass the data using
ctor
.
First Form
button_click(...)
{
string userName = "admin";
SecondForm sf = new SecondForm(userName);
sf.Show();
}
Second Form
string userName;
public SecondForm(string userName)
{
this.userName = userName;
lbl.Text = userName;
}
-KR