Results 1 to 2 of 2

Thread: Blocking Alt+F4....

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2000
    Location
    India
    Posts
    298
    Hi,

    I am running a .avi file in my VB application. During this time I need to block all input(mouse & KB) which I've managed. The only thing I haven't quite figured out is how to block the "ALT+F4" combination. Can anyone help me out here?

    Thanks in advance,
    Ramya.

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You could do this in two ways. Set the ControlBox property of the form to False, or you can use the QueryUnload event.
    Code:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        If UnloadMode = vbFormControlMenu Then
        'if the user pressed ALT+F4 or clicked on the
        'close button (X) on the form then cancel the
        'unload.
            Cancel = True
        End If
    End Sub
    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width