MDI child form does not show MdiList property in VS2005

  • Thread starter Thread starter Guest
  • Start date Start date
You can create the child forms and "attach" them to the parent like this.
This is a sub that's performed to open a new child, called from the parent.

Private Sub OpenProductChild()
Dim frmProduct as New ProductForm
frmProduct.MdiParent = Me
frmProduct.Show()
End Sub

Then from the parent, you can access the children by enumerating through
them. This is one way to close all the child forms.

For Each childForm as Form in Me.MdiChildren
ChildForm.Close()
Next

I created the parent form using the MDI Parent Form Template, so it had
whatever settings it needed to be an MDIparent.

Hope that helps.
Robin S.
 
Robin,

Thanks!
You pointed the trick: creating the MDI Parent from the form template
automatically generates code that will create child forms.

Ricardo
 
Good. And just FYI, I believe you can change a form you have already
created *into* an MDI form by doing the following:

-- Set the IsMDIContainer property for the form to True.
-- Add a MenuStrip, ToolStrip, and StatusStrip, or other controls, to the
form.
You can easily afdd the most common items to the MenuStrip and ToolStrip
by using the smart tag on each one and selecting "Insert Standard
Items".

It's easier to start with the MDIParent template, but it's good to know
another way.

Robin S.
 
Back
Top