|
|
Title | Unload an application's forms in reverse order of creation |
Description | This example shows how to unload an application's forms in reverse order of creation in Visual Basic 6. |
Keywords | close, unload, form |
Categories | Software 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:
|
|
|
|
|
|