开智明目功赵金香:在C#中 如何让MDI的子窗体不重复
来源:百度文库 编辑:高考问答 时间:2024/04/30 06:30:51
foreach (Form froms in this.MdiChildren )
{//获取MID里的所有子窗体
if (froms is Form2)
{//判断是否有Form2
froms.Focus();//获得焦点
return;//退出过程
}
}//没有Form2就Show 一个出来
Form2 f = new Form2();
f.MdiParent = this;
f.Show();