If MDIForm.MdiChildren.Length1 Then
'如果没有任何一个MDI子窗体,则创该MDI子窗体的窗体实例
Dim MDIChildFrm As Windows.Forms.Form = MDIChildForm ' 定义MDI子窗体
MDIChildFrm.MdiParent = MDIForm '指定父窗体
MDIChildFrm.Show() '打开窗体
Exit Sub
Else
Dim x As Integer
Dim frmyn As Boolean
For x = 0 To (MDIForm.MdiChildren.Length) - 1
Dim tempChild As Windows.Forms.Form = CType(MDIForm.MdiChildren(x), Windows.Forms.Form)
If tempChild.Name = MDIChildFormName Then
'检测到有该MDI子窗体,设为激活 并退出循环
frmyn = True
tempChild.BringToFront()
Exit For
Else
frmyn = False
End If
Next
If Not frmyn Then
'在打开的窗体中没检测到则新建
Dim MDIChildFrm As Windows.Forms.Form = MDIChildForm ' 定义MDI子窗体
MDIChildFrm.MdiParent = MDIForm '指定父窗体
MDIChildFrm.Show() '打开窗体
End If
End If
End Sub
【vb.net增加窗体 vb2010如何添加窗体】关于vb.net增加窗体和vb2010如何添加窗体的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站 。
推荐阅读
- 推荐好玩儿射击游戏男生,射击类好玩的手游
- 长得最像安卓的苹果手机,最像苹果的安卓系统
- 树和喜鹊动作表演游戏,树和喜鹊示范课
- python爬虫加载,python爬虫等待网页加载
- MySQL行锁怎么开启 mysql 行锁锁住的是什么
- sqlserver企业破解版,sqlserver2019破解版
- 新显卡插老机器怎么用不了,老显卡插新主板有什么问题吗?
- b站怎么用电脑直播手机,b站怎样用电脑直播
- mysql运行错误怎么办 mysql报错大全