标签:
我的思路是将窗体作为参数来传递
private void button1_Click(object sender, EventArgs e)
{
Form2 f = new Form2(this);
f.Show();
this.Hide();
}
form2中代码
private Form parent;
public Form2(System.Windows.Forms.Form f)
{
InitializeComponent();
this.parent = f;
}
private void button1_Click(object sender, EventArgs e)
{
parent.Show();
this.Hide();
}
然而最简单的是
private void click()
{
Form2 f2=new Form2();
this.Hide();
f2.ShowDialog();
this.show();
}
标签:
原文地址:http://www.cnblogs.com/CurryZhang/p/5274799.html