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

推荐订阅源

C
Check Point Blog
J
Java Code Geeks
H
Hackread – Cybersecurity News, Data Breaches, AI and More
D
Docker
腾讯CDC
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
Microsoft Security Blog
Microsoft Security Blog
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
博客园 - 司徒正美
T
The Blog of Author Tim Ferriss
Vercel News
Vercel News
P
Proofpoint News Feed
雷峰网
雷峰网
博客园_首页
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
爱范儿
爱范儿
V
V2EX
F
Fortinet All Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
MyScale Blog
MyScale Blog
S
SegmentFault 最新的问题

博客园 - 编程山人

品牌大全 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(); 
}