bool v = false;
foreach (Form frm in this.MdiChildren) //防止子窗体重复打开
{
if (frm.Name == "frm1CounterTower") //frm1CounterTower 为子窗体的名称
{
v = true;
}
}
if (!v)
{
frm1CounterTower myfrm = new frm1CounterTower();
myfrm.TopLevel = false;
myfrm.MdiParent = this;
myfrm.StartPosition = FormStartPosition.CenterScreen;
myfrm.Show();
}