Exemple #1
0
        private void button3_Click(object sender, EventArgs e)
        {
            Form f = Application.OpenForms["XuanquAnli"]; //查找是否打开过Form1窗体

            if (f == null)                                //没打开过
            {
                XuanquAnli xuanquanli = new XuanquAnli();
                xuanquanli.MdiParent = this.MdiParent;
                xuanquanli.Show();
            }
            else
            {
                f.Focus();   //打开过就让其获得焦点
            }
        }
Exemple #2
0
 private void button3_Click(object sender, EventArgs e)
 {
     Form f = Application.OpenForms["XuanquAnli"];  //查找是否打开过Form1窗体
     if (f == null) //没打开过
     {
         XuanquAnli xuanquanli = new XuanquAnli();
         xuanquanli.MdiParent = this.MdiParent;
         xuanquanli.Show();
     }
     else
     {
         f.Focus();   //打开过就让其获得焦点
     }
 }