惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
V
Visual Studio Blog
博客园 - 三生石上(FineUI控件)
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
爱范儿
爱范儿
J
Java Code Geeks
A
About on SuperTechFans
F
Fortinet All Blogs
B
Blog
aimingoo的专栏
aimingoo的专栏
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Engineering at Meta
Engineering at Meta
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
G
Google Developers Blog
Apple Machine Learning Research
Apple Machine Learning Research
V
V2EX
博客园_首页
博客园 - 叶小钗
罗磊的独立博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
D
Docker
云风的 BLOG
云风的 BLOG

博客园 - 编程山人

品牌大全 C#类中的get 和set 函数的具体用法 What's TM? 在C#中利用SharpZipLib进行文件的压缩和解压缩 在C#中运用SQLDMO备份和恢复Microsoft SQL Server数据库 WinForm实现SQLServer存储图片 通过C#调用CHM帮助文件 [Remoting专题系列] 一:.NET Remoting [Remoting专题系列] 二:远程对象 [Remoting专题系列] 三:激活模式 [Remoting专题系列] 四:生存期租约 [Remoting专题系列] 五:信道 [Remoting专题系列] 六:异步调用 [Remoting专题系列] 七:调用上下文 [Remoting专题系列] 八:元数据 [Remoting专题系列] 九:动态发布 [Remoting专题系列] 十:追踪服务 [Remoting专题系列] 十一:事件 [Remoting专题系列] 十二:配置文件
控制只生成一个子窗体(简单)
编程山人 · 2007-08-09 · via 博客园 - 编程山人

呵呵,很简单,先定义一个窗体变量;
 如: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(); 
}