|
-
Dec 7th, 1999, 10:25 PM
#1
Thread Starter
Hyperactive Member
I need to capture when the user hits ESC. I don't know the ASCII Character Code for it and I'm not sure whether I can capture it like all the other keys or whether I need to use an API.
-
Dec 7th, 1999, 10:47 PM
#2
Junior Member
The keycode is vbKeyEscape and I believe its value is 27. You can capture this key.
In the keypress event it would look like if keyascii = vbkeyescape then whatever
For a command button you just need to set the cancel propery to true.
Hope this helps!
-
Dec 7th, 1999, 10:49 PM
#3
Lively Member
the keycode for esc is 27
-
Dec 7th, 1999, 10:49 PM
#4
Lively Member
set the form's keypreview property to true
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyEscape Then
MsgBox "Escape"
End If
End Sub
-
Dec 7th, 1999, 10:59 PM
#5
Thread Starter
Hyperactive Member
thanks, key code 27 is what I needed.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|