This will not work Rob. If I put this in ChildB, it would not recognize
"FormParent ". Also, generally why make a second dim for multiple instances?
My code:
Public Class FormParent
Inherits System.Windows. Forms.Form
Windows Form Designer generated code
Public Shared childBInst As New childB
Private Sub OpenChildA_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles OpenChildA.Clic k
Dim childAInst As New childA
With childAInst
..MdiParent = Me
..Show()
..Text = "1st"
End With
childBInst.MdiP arent = Me
End Sub
End Class
-------------------------------------
Public Class childA
Inherits System.Windows. Forms.Form
Windows Form Designer generated code
Private Sub OpenChildB_Clic k(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles OpenChildB.Clic k
with FormParent.chil dBInst
..Show()
..Text = "2nd"
End With
End Sub
End Class
"Rob Teixeira [MVP]" <RobTeixeira@@m sn.com> wrote in message
news:ON******** ******@tk2msftn gp13.phx.gbl...
Dim newFormB as New FormChildB
newFormB.MDIPar ent = FormParent
newFormB.Show
-Rob Teixeira [MVP]
"Paul Mars" <pa************ @netzero.com> wrote in message
news:O3******** **********@tk2m sftngp13.phx.gb l... your newFormB would then not be a child. It needs to be child of
FormParent.
The original FormChildB and FormChildA are both declared in FormParent.
FormChildB is module level Public Shared