VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Disable ALT+F4 in a Form

by Marcus Schmitt (6 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (2 Votes)

Disable the shortcut ALT+F4 in a Form

Rate Disable ALT+F4 in a Form

Private Sub Form_Load()
  Me.KeyPreview = True
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  If (Shift = vbAltMask) Then
    Select Case KeyCode
      Case vbKeyF4
      KeyCode = 0
    End Select
  End If
End Sub

Download this snippet    Add to My Saved Code

Disable ALT+F4 in a Form Comments

No comments have been posted about Disable ALT+F4 in a Form. Why not be the first to post a comment about Disable ALT+F4 in a Form.

Post your comment

Subject:
Message:
0/1000 characters