Search Tools Links Login

Close all forms within a project.


Visual Basic 6, or VB Classic

Add this code to a module and simply use CloseAll to unload all forms in your project.

Original Author: Mike

Side Effects

None that I know off, I haven't had any problems yet... a decrease in use of Unload and End?

Code

Sub CloseAll()
On Error Resume Next
Dim intFrmNum As Integer
intFrmNum = Forms.Count
Do Until intFrmNum = 0
Unload Forms(intFrmNum - 1)
intFrmNum = intFrmNum - 1
Loop
End Sub

About this post

Posted: 2003-06-01
By: ArchiveBot
Viewed: 109 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.