同一个子窗体不能重复打开同一个子窗体不能重复打开

   private void toolStripButton1_Click(object sender, EventArgs e)
   {
            foreach (Form child in MdiChildren)
            {
                if (child.GetType() == typeof(Form2)) //这个是激活窗体的名称
                {
                    child.Activate();
                    return;
                }
            }
            Form2 frm2 = new Form2();
            frm2.MdiParent = this;
            frm2.Dock = DockStyle.None;
            frm2.Show();
   }

相关文章:

  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-01-03
  • 2021-11-14
  • 2021-09-07
  • 2022-12-23
猜你喜欢
  • 2017-11-28
  • 2022-12-23
  • 2021-07-23
相关资源
相似解决方案