Create a custom property on FormC that will contain the reference to the
parent (FormA). Modify the Constructor of FormC (New()) to take this value
as a parameter and set it. Then when you create FormB, set the parent to
that.
Example:
In FormC:
Sub New(ByRef MainParent as form)
me.ParentToSet = MainParent 'your custom property
End Sub
Sub OpenFormB()
Dim x as new FormB
x.mdiParent = me.ParentToSet
x.show()
Sub
or you can also modify FormB's constructor and pass the reference as a
parameter:
In FormB:
Sub New(ByRef MainParent as form)
me.mdiParent = MainParent
End Sub
In FormC
Sub OpenFormB()
Dim x as new FormB(me.ParentToSet)
x.show()
Sub
Good luck!
"Ben dotNet" <Be*@myserver.com> wrote in message
news:%2*****************@TK2MSFTNGP10.phx.gbl...
FormA is the mdiParent
FormB is the child
FormC is the Form that is used to open FormB
How do I open FormB from FormC (that is not a child) so that it it's
mdiParent is FormA?
Thanks,
--Ben