創(chuàng)建父窗體form1:
創(chuàng)新互聯(lián)長期為上1000+客戶提供的網(wǎng)站建設服務,團隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務;打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為筠連企業(yè)提供專業(yè)的成都網(wǎng)站設計、做網(wǎng)站,筠連網(wǎng)站改版等技術(shù)服務。擁有十年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。
注意: 1).IsMIdContainer屬性改為true(默認為false)--獲取或設置一個值,該值指示窗體是否為多文檔界面 (MDI) 子窗體的容器
創(chuàng)建子窗體formchid1,formchid2,formchid3,formchid4,在父窗體form1中創(chuàng)建4個按鈕button1,button2,button3,button4 分別打開上面4個子窗體
3.父窗體部分代碼:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
formchid1.MdiParent = Me
'formchid1.TopLevel = False
'formchid1.Parent = Me
formchid1.Dock = DockStyle.Fill
formchid1.Show()
formchid1.BringToFront()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
formchid2.MdiParent = Me
'formchid2.TopLevel = False
'formchid2.Parent = Me
formchid2.Dock = DockStyle.Fill
formchid2.Show()
formchid2.BringToFront()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
formchid3.MdiParent = Me
'formchid3.TopLevel = False
'formchid3.Parent = Me
formchid3.Dock = DockStyle.Fill
formchid3.Show()
formchid3.BringToFront()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
formchid4.MdiParent = Me
'formchid4.TopLevel = False
'formchid4.Parent = Me
formchid4.Dock = DockStyle.Fill
formchid4.Show()
formchid4.BringToFront()
End Sub