I want to pass values between two Forms (c#). How can I do it?
I have two forms: Form1 and Form2.
Form1 contains one button. When I click on that button, Fo
Define a property
public static class ControlID {
public static string TextData { get; set; }
}
In the form2
private void button1_Click(object sender, EventArgs e)
{
ControlID.TextData = txtTextData.Text;
}
Getting the data in form1
and form3
private void button1_Click(object sender, EventArgs e)
{
string text= ControlID.TextData;
}