|
-
Sep 20th, 2000, 09:07 PM
#1
Set the form's KeyPreview property to True.
Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = (192) Then Debug.Print ("~")
End Sub
-
Sep 20th, 2000, 09:30 PM
#2
Conquistador
-
Sep 20th, 2000, 10:43 PM
#3
KeyPreview Property - Returns or sets a value that determines whether keyboard events for forms are invoked before keyboard events for controls. The keyboard events are KeyDown, KeyUp, and KeyPress.
-
Sep 20th, 2000, 11:59 PM
#4
Conquistador
is there a way to do this with the mouse?
like: mousepreview?
-
Sep 21st, 2000, 06:21 AM
#5
Try this:
Code:
Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
If GetAsyncKeyState(1) Then Debug.Print "Left mouse button"
If GetAsyncKeyState(2) Then Debug.Print "Right mouse button"
End Sub
-
Sep 21st, 2000, 05:47 PM
#6
Conquistador
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
|