在Form1中,点击button1,显示Form2
private void button1_Click(object sender, EventArgs e)
{
//隐藏当前窗口
this.Visible = false;
Form2 f2 = new Form2();
//显示Form2
f2.ShowDialog();
//显示当前窗口
this.Visible = true;
}
form1的代码
form2 frm2 = new form2();
frm2.show();
this.visible=false;
form2的代码
form1 frm1 = new form1();
frm1.show();
this.visible=false;