Results 1 to 4 of 4

Thread: MDI forms

  1. #1

    Thread Starter
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    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

  2. #2
    New Member
    Join Date
    Feb 2000
    Posts
    8

    Post

    Uh, sortof...You can use the Forms collection which will return ALL the loaded forms and just skip the MDIForm.

    Code:
    For Each Form In Forms
        'replace with correct MDIForm name
        If Form.Name <> MDIForm1.Name Then
            MsgBox Form.Name
        End If
    Next
    If your MDIForm is named MyMainForm then you can use:
    If Form.Name <> MyMainForm.Name Then
    Or
    If Form.Name <> "MyMainForm" Then

    Hope this helps!

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    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).]

  4. #4

    Thread Starter
    Hyperactive Member Gimpster's Avatar
    Join Date
    Oct 1999
    Location
    Redmond, WA 98052
    Posts
    331

    Post

    Ok, great thank guys. This is exactly what I was looking for.

    ------------------
    Ryan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width