无题

在Win应用中,经常会遇到这样的应用,Form2打开时,隐藏Form1,Form2关闭时,显示Form1
可以这样处理
1XtraForm2 frm = new XtraForm2();
2this.Visible = false;
3frm.ShowDialog();
4this.Visible = true;
对于MDI中的窗体可以这样处理
 1FRM frm = new FRM();
 2frm.MdiParent = this.MdiParent;
 3frm.FormClosed += new FormClosedEventHandler(frm_FormClosed);
 4this.Visible = false;
 5frm.Show();
 6
 7  void frm_FormClosed(object sender, FormClosedEventArgs e)
 8  {
 9     this.Visible = true;
10  }
----------------------------------- http://www.cnblogs.com/rock_chen/
原文地址:https://www.cnblogs.com/rock_chen/p/1165910.html