Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
500MB 27GB Web Hosting - $9.95/Month
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleSee why a form is closing
Keywordsclose, unload, QueryUnload, UnloadMode, closing
CategoriesTips and Tricks
 
In the QueryUnload event handler, use the UnloadMode parameter to see why the form is unloading.
 
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode _
    As Integer)
    Select Case UnloadMode
        Case vbFormControlMenu
            MsgBox Caption & ": Close command from Control " & _
                "menu or X button."
        Case vbFormCode
            MsgBox Caption & ": Unload statement from code."
        Case vbAppWindows
            MsgBox Caption & ": Windows session ending."
        Case vbAppTaskManager
            MsgBox Caption & ": Task Manager close."
        Case vbFormMDIForm
            MsgBox Caption & ": MDI parent is closing."
        Case vbFormOwner
            MsgBox Caption & ": Owner is closing."
    End Select
End Sub
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated