博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

C#实现窗口的跳转

Posted on 2008-08-11 14:36  Anna Yang  阅读(1131)  评论(0编辑  收藏  举报

  

 1      private frmReworkInfo frmRwInfo;
 2      private void InformationMenuItem_Click(object sender, EventArgs e)
 3         {
 4             if (frmRwInfo == null || frmRwInfo.IsDisposed)
 5             {
 6                 this.MinimizeChildForm();
 7                 frmRwInfo = new frmReworkInfo(); 
 8                 frmRwInfo.MdiParent = this;
 9                 frmRwInfo.Show(); 
10              }
11         } 
12 
13         //Minimize All Child Forms
14         private void MinimizeChildForm()
15         {
16             foreach (Form childForm in MdiChildren)
17             {
18                 if (childForm.WindowState != FormWindowState.Minimized)
19                 {
20                     childForm.WindowState = FormWindowState.Minimized;
21                 }
22             }
23         }
24 
25