Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleUnload an application's forms in reverse order of creation
DescriptionThis example shows how to unload an application's forms in reverse order of creation in Visual Basic 6.
Keywordsclose, unload, form
CategoriesSoftware Engineering, Controls
 
Click the New button to make a new instance of the program's form. Click the Close All button to run the following code, which loops through the Forms collection unloading the forms, most recently created first.
 
Private Sub cmdCloseAll_Click()
    Do While Forms.Count > 0
        Unload Forms(Forms.Count - 1)
    Loop
End Sub
 
This example gets stuck in an infinite loop if one of the forms fails to unload.

See also:

 
 
Copyright © 1997-2006 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated