窗體 Form1)
成都創(chuàng)新互聯(lián)公司是一家集網(wǎng)站建設(shè),雞冠企業(yè)網(wǎng)站建設(shè),雞冠品牌網(wǎng)站建設(shè),網(wǎng)站定制,雞冠網(wǎng)站建設(shè)報(bào)價(jià),網(wǎng)絡(luò)營(yíng)銷,網(wǎng)絡(luò)優(yōu)化,雞冠網(wǎng)站推廣為一體的創(chuàng)新建站企業(yè),幫助傳統(tǒng)企業(yè)提升企業(yè)形象加強(qiáng)企業(yè)競(jìng)爭(zhēng)力??沙浞譂M足這一群體相比中小企業(yè)更為豐富、高端、多元的互聯(lián)網(wǎng)需求。同時(shí)我們時(shí)刻保持專業(yè)、時(shí)尚、前沿,時(shí)刻以成就客戶成長(zhǎng)自我,堅(jiān)持不斷學(xué)習(xí)、思考、沉淀、凈化自己,讓我們?yōu)楦嗟钠髽I(yè)打造出實(shí)用型網(wǎng)站。
Me.Size = New Size(Screen.PrimaryScreen.WorkingArea.Width, Screen.PrimaryScreen.WorkingArea.Height)
(子窗體 Form2)
Me.Size = New Size(Screen.PrimaryScreen.WorkingArea.Width / 4, Screen.PrimaryScreen.WorkingArea.Height)
顯示子窗體的時(shí)候隱藏父窗體,關(guān)閉子窗體的時(shí)候再顯示父窗體
直接添加一個(gè)MID父窗體或在已有窗體的屬性中找到IsMDIContainer屬性,然后設(shè)置為True,然后創(chuàng)建第二個(gè)窗體 ,需要加載子窗體的時(shí)候:
Dim NewMDIChild As New Form2
NewMDIChild.MdiParent = Me
NewMDIChild.Show()
Public?Shared?Sub?CheckMDIChildForm(ByVal?MDIForm?As?Windows.Forms.Form,?ByVal?MDIChildForm?As?Windows.Forms.Form,?ByVal?MDIChildFormName?As?String)
If?MDIForm.MdiChildren.Length??1?Then
'如果沒有任何一個(gè)MDI子窗體,則創(chuàng)該MDI子窗體的窗體實(shí)例
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
'檢測(cè)到有該MDI子窗體,設(shè)為激活?并退出循環(huán)
frmyn?=?True
tempChild.BringToFront()
Exit?For
Else
frmyn?=?False
End?If
Next
If?Not?frmyn?Then
'在打開的窗體中沒檢測(cè)到則新建
Dim?MDIChildFrm?As?Windows.Forms.Form?=?MDIChildForm?'?定義MDI子窗體
MDIChildFrm.MdiParent?=?MDIForm?'指定父窗體
MDIChildFrm.Show()?'打開窗體
End?If
End?If
End?Sub