How to open a mdi child form from another with vb in the main mdi parent?
Asked
Active
Viewed 1.0k times
2 Answers
7
In the first MDI child you can create an instance of the secon MDI child, set the MdiParent of the second instance equal to the MdiParent of the first and show the child.
So in the first Mdi child the following code will show a second MDI child
Dim mdiChildForm As New MyMdiChild
mdiChildForm.MdiParent = Me.MdiParent
mdiChildForm.Show()

Chris Taylor
- 52,623
- 10
- 78
- 89
-
Using "form" for the identifier name might be a bit confusing, as you could also say dim MyMdiChild as form and it would also work. – xpda May 08 '10 at 00:57
-
Yes and for c#:- MyMdiChild newMDIChild = new MyMdiChild(); newMDIChild.MdiParent = this.MdiParent; newMDIChild.Show(); – rjdmello Aug 21 '13 at 05:27
2
This will help u
Dim ChildForm As New System.Windows.Forms.Form
ChildForm.MdiParent = Me
m_ChildFormNumber += 1
ChildForm.Text = "Window " & m_ChildFormNumber
ChildForm.Show()

Chanaka
- 21
- 1