110,534
社区成员
发帖
与我相关
我的任务
分享
//窗体1
private void btn1_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2();
this.Hide();
f2.Show();
}
//窗体2
private void button1_Click(object sender, EventArgs e)
{
Form1 f1 = new Form1();
this.Hide();
f1.Show();
}
foreach (Form f in Application.OpenForms)
{
if (f is FormA)
{
MessageBox.Show("FormA已打开");
}
}
//窗体A
private void button1_Click(object sender, EventArgs e)
{
FormB fb = new FormB();
fb.Owner = this;
fb.Show();
this.Hide();
}
//窗体B
private void button1_Click(object sender, EventArgs e)
{
this.Owner.Show();
this.Close();
}