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

推荐订阅源

OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
L
LangChain Blog
WordPress大学
WordPress大学
MyScale Blog
MyScale Blog
The Cloudflare Blog
J
Java Code Geeks
Google DeepMind News
Google DeepMind News
Recent Announcements
Recent Announcements
Microsoft Azure Blog
Microsoft Azure Blog
Y
Y Combinator Blog
有赞技术团队
有赞技术团队
Last Week in AI
Last Week in AI
酷 壳 – CoolShell
酷 壳 – CoolShell
Martin Fowler
Martin Fowler
小众软件
小众软件
量子位
月光博客
月光博客
P
Proofpoint News Feed
IT之家
IT之家
腾讯CDC
博客园 - 三生石上(FineUI控件)
博客园 - 司徒正美
雷峰网
雷峰网
V
Visual Studio 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(); 
}