Ejemplo n.º 1
0
        private void button4_Click(object sender, EventArgs e)
        {
            Form f = Application.OpenForms["Fenpei"]; //查找是否打开过Form1窗体

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

            }
            else
            {
                f.Focus();   //打开过就让其获得焦点
            }
        }