CodeItBetter Programming Another VB Programming Blog

How to cancel the user action when the user trying to close the application using task manager.

Posted on January 4, 2009
1
2
3
4
5
6
7
8
'Forms - How to cancel the user action when the user trying to close the application using task manager.
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    ' Don't let the user close this form.
    Select Case UnloadMode
    Case vbFormControlMenu, vbAppTaskManager
        Cancel = True
    End Select
End Sub

Related posts:

  1. How to find the user is trying to close the application using task manager or by pressing the X in Title bar, etc. How to restrict/refuse that
  2. How to find out how the form is unloading
  3. How to confirm the user before exiting your application
  4. How to Set an application’s Task Manager icon
  5. How to Undo the last User Action in Text Box
  6. How to Check whether the user pressed the Cancel Button on Input Box
  7. How to hide your exe file from Task Manager Applications Tab
  8. How to Load an application’s form and Task Manager icons from a resource file
  9. Validate Event Example
  10. How to use code that allows the user to abort, retry, or ignore when an error occurs

Filed under: Forms Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.