您好,登錄后才能下訂單哦!
創建父窗體form1:
注意: 1).IsMIdContainer屬性改為true(默認為false)--獲取或設置一個值,該值指示窗體是否為多文檔界面 (MDI) 子窗體的容器
創建子窗體formchid1,formchid2,formchid3,formchid4,在父窗體form1中創建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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。