NewC c;
foreach(Form f in this.mdichindren)
{
if(f is NewC)
{
c=f;
f.show
}
}
if(c==null)
{
c.Show();
c.mdi~~=this;}
好象是这样,.就这个思路。
代码手写的,错误多多要对主窗口的菜单项进行设置,可以做为参数传到子窗体
foreach(Form f in this.mdichindren)
{
if(f is NewC)
{
c=f;
f.show
}
}
if(c==null)
{
c.Show();
c.mdi~~=this;}
好象是这样,.就这个思路。
代码手写的,错误多多要对主窗口的菜单项进行设置,可以做为参数传到子窗体
foreach(Form f in this.mdichindren)
{
if(f is NewC)
{
c=f;
f.show
}
}
if(c==null)
{
c=new NewC ();
c.Show();
c.mdi~~=this;}
private static bool mExited = true; // 窗口是否已退出, true 已退出, false 未退出
public static bool Exited
{
get { return mExited; } // 只读属性
}在 Load 事件中加入: mExited = false;
在 Closed 事件中加入: mExited = true;调用:if(Form1.Exited) new Form1().Show();
foreach(Form f in this.MdiChildren)
{
if(f is BadCard)
{
form=(BadCard)f;
break; }
}
if(form!=null)
{
form.Show();
form.WindowState=FormWindowState.Maximized;
}
else
{
form=new BadCard();
form.MdiParent=this;
form.Show();
}