3个回答
展开全部
防止子窗口重复打开,确保某一子窗口只打开一次。代码为:
foreach (Form frm in this.MdiChildren)
...{
if (frm is WorkerList)
...{
frm.WindowState = FormWindowState.Normal;
frm.Activate();
return;
}
}
WorkerList wl = new WorkerList();
wl.MdiParent = this;
wl.Show();
foreach (Form frm in this.MdiChildren)
...{
if (frm is WorkerList)
...{
frm.WindowState = FormWindowState.Normal;
frm.Activate();
return;
}
}
WorkerList wl = new WorkerList();
wl.MdiParent = this;
wl.Show();
展开全部
防止子窗口重复打开,确保某一子窗口只打开一次。代码为:
foreach
(Form
frm
in
this.MdiChildren)
...{
if
(frm
is
WorkerList)
...{
frm.WindowState
=
FormWindowState.Normal;
frm.Activate();
return;
}
}
WorkerList
wl
=
new
WorkerList();
wl.MdiParent
=
this;
wl.Show();
foreach
(Form
frm
in
this.MdiChildren)
...{
if
(frm
is
WorkerList)
...{
frm.WindowState
=
FormWindowState.Normal;
frm.Activate();
return;
}
}
WorkerList
wl
=
new
WorkerList();
wl.MdiParent
=
this;
wl.Show();
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
将窗体得构造方法改为私有 提供静态方法创建窗体得实例,如果窗体实例已经存在直接返回 如果不存在NEW一个新得返回 这样每个窗体同时只有一个实例对象运行
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询