CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2002
    Location
    Toronto
    Posts
    167

    closing MDIChild forms

    is there a way to close all MDIChild forms without keeping track of the ones the user has open, leaving just the MDIParent form open?

  2. #2
    Join Date
    Jun 2001
    Location
    MO, USA
    Posts
    2,868
    Try something like this:

    While not me.ActiveMDIChild is nothing
    me.activemdiChild.Close
    Loop

  3. #3
    Join Date
    Oct 2002
    Location
    Växjö, Sweden
    Posts
    225
    or something like this....

    Code:
    Dim frm As Form
    For Each frm In Me.MdiChildren
        frm.Close()
    Next
    If you are not closing them from the parent window you will have to do something like this...

    Code:
    Dim frm As Form
    For Each frm In Me.ParentForm.MdiChildren
        frm.Close()
    Next
    /Leyan

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

Featured