vb.net中如何设定mdi子窗体
有一个窗体Form1,和一个MDIForm1,怎样设定Form1是MDIForm1的子窗体?
[解决办法]
Private Sub ShowNewForm(ByVal sender As Object, ByVal e As EventArgs) Handles NewToolStripMenuItem.Click, NewToolStripButton.Click, NewWindowToolStripMenuItem.Click
' 创建此子窗体的一个新实例。
'把 Dim ChildForm As New System.Windows.Forms.Form
'改成
Dim ChildForm As New Form1
' 在显示该窗体前使其成为此 MDI 窗体的子窗体。
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "窗口 " & m_ChildFormNumber
ChildForm.Show()
End Sub