Results 1 to 2 of 2

Thread: Closing forms from mdiparent

  1. #1

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394

    Closing forms from mdiparent

    ok, I need to be able to close all open forms for an MDI application except for the MDI parent.

    now initially I was doing this by iterating through the mdiparent mdichildren collection as follows...

    VB Code:
    1. Dim oForm As System.Windows.Forms.Form
    2.          For Each oForm In Me.MdiChildren
    3.             oForm.Dispose()
    4.          Next

    Which works fine - except that one of the children (damn kids) may have started another non child form - displayed modally.
    (and possibly this form has in turn displayed another modal no child form).

    I need to be able to also close down these non-children forms...

    Any ideas? I would have thought that there was an application level collection of open forms somewhere that I could iterate through (ignoring my parent).

    Thanks

  2. #2

    Thread Starter
    Hyperactive Member Bananafish's Avatar
    Join Date
    Jan 2001
    Posts
    394
    ok - having searched the net, I found an article on the visual studio magazine web site - thefives info on the forms collection from vb6 and how to get around the fact that it isn't there in .net.

    http://www.fawcette.com/vsm/2002_12/...hottips/lobel/

    looks like it could have the answer.

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