Does an MDI Parent form have a collection of all of it's Child forms? I mean, like the way a form has a collection of all of the controls on it. Does an MDI Parent form have something like that? And if so, how do you use it?
------------------
Ryan
Printable View
Does an MDI Parent form have a collection of all of it's Child forms? I mean, like the way a form has a collection of all of the controls on it. Does an MDI Parent form have something like that? And if so, how do you use it?
------------------
Ryan
Uh, sortof...You can use the Forms collection which will return ALL the loaded forms and just skip the MDIForm.
If your MDIForm is named MyMainForm then you can use:Code:For Each Form In Forms
'replace with correct MDIForm name
If Form.Name <> MDIForm1.Name Then
MsgBox Form.Name
End If
Next
If Form.Name <> MyMainForm.Name Then
Or
If Form.Name <> "MyMainForm" Then
Hope this helps!
Just a small correction. Not every form in the Forms collection is necessary a MDIChild form.
Dim frm As Form
On Error Resume Next
For Each frm In Forms
If frm.MDIChild Then
MsgBox frm.Name
End If
Next
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
[This message has been edited by Joacim Andersson (edited 02-08-2000).]
Ok, great thank guys. This is exactly what I was looking for.
------------------
Ryan