VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Code to ensure that all open windows are closed when the main program exits.

by Joe Dacy II (6 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sun 4th March 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Code to ensure that all open windows are closed when the main program exits.

Rate Code to ensure that all open windows are closed when the main program exits.



Private Sub Form_Unload(Cancel As Integer)
' placed in the main form's unload procedure
For Each Form In Forms
If Form.Visible = True Then
Unload Form
End If
Next
End Sub


Download this snippet    Add to My Saved Code

Code to ensure that all open windows are closed when the main program exits. Comments

No comments have been posted about Code to ensure that all open windows are closed when the main program exits.. Why not be the first to post a comment about Code to ensure that all open windows are closed when the main program exits..

Post your comment

Subject:
Message:
0/1000 characters