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
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