How can I set the MDI Parent property

  • Thread starter Thread starter suresh
  • Start date Start date
me.mdiparent = frmparent (but you will have to declare the frmparent as a
public shared instance of your parent form)

eric
 
suresh said:
How can I set the MDI Parent property for a child form
from that child form itself?

??

Maybe
Me.MdiParent = TheParentForm
?

But why do you need this?
 
* "suresh said:
How can I set the MDI Parent property for a child form
from that child form itself?

\\\
Me.MdiParent = <reference to MDI container>
///
 
suresh,
In addition to the others, I will sometimes define a second constructor in
the child form that accepts the parent, then use that to set it.

Something like:

Public Class ChildForm
Inherits Form

' designer needs this, others do not
Private Sub New()
InitializeComponent()
End Sub

Public Sub New(parentForm As Form)
MyClass.New()
me.MdiParent = parentForm
End Sub

...

End Class

Hope this helps
Jay
 
Back
Top