会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
IT难民
Visual Studio 2005--- Developer EXpress 2005
博客园
首页
新随笔
管理
控制只生成一个子窗体(简单)
控制只生成一个子窗体
呵呵,很简单,先定义一个窗体变量;
如:frmDirTool() DirTool
=
null
;
然后再从生成这个窗体的点击事件中写入
if
(DirTool
==
null
)
{
DirTool
=
new
frmDirTool();
DirTool.MdiParent
=
this
;
DirTool.Show();
}
---------------------------------------
还要控制第二次打开新的子窗体
if
(DirTool
==
null
)
//
如果还没有字窗体时,则创建新的子窗体
{
DirTool
=
new
frmDirTool();
DirTool.MdiParent
=
this
;
DirTool.Show();
}
else
if
(DirTool.IsDisposed)
//
如果曾有字窗体,但又关闭了,则创建新的子窗体
{
DirTool
=
new
frmDirTool();
DirTool.MdiParent
=
this
;
DirTool.Show();
}
posted on
2007-08-09 21:17
编程山人
阅读(
497
) 评论(
0
)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面
返回顶部