How can I set the MDI Parent property

  • Thread starter Thread starter suresh
  • Start date Start date
S

suresh

How can I set the MDI Parent property for a child form
from that child form itself?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top