Hi,
This has bothered me for a while.
In Form1:
private void btnToForm2_Click(object sender, System.EventArgs e)
{
Form2 MyForm2=new Form2();
MyForm2.Show();
MyForm2.textBox1.Text="open Form 2 ";
}
If I close the Form1 at this moment, the program will be closed, since the
Form1 is the starting form.
In Form2:
private void btnToForm1_Click(object sender, System.EventArgs e)
{
Form1 MyForm1=new Form1();
MyForm1.Show();
MyForm1.textBox1.Text="open Form 1 ";
this.Close();
}
My question is when I was in Form2, how can I return to the original Form1
and change the value of the Form1.textBox1 without creating another new
Form1? What have I done wrong?
Any help will be appreciated.
Jason