|
-
January 11th, 2000, 06:48 AM
#1
How to catch a keyboard key?
I have an explorer style application (with 2 user controls - tree and list, toolbar etc..)
I need to know when the user presses the "Ctrl" key in any place in the application.
What is the way to do it?
Thanks Sigal
-
January 11th, 2000, 07:11 AM
#2
Re: How to catch a keyboard key?
set the Keypreview property of the form to true and trap all keypress, keydown, keyup event at the Form_Keypress event handler level
-
January 11th, 2000, 07:13 AM
#3
Re: How to catch a keyboard key?
sample:
private Sub Form_KeyDown(KeyCode as Integer, Shift as Integer)
If Shift And vbKeyControl = vbKeyControl then
MsgBox "control pressed"
End If
End Sub
-
January 11th, 2000, 07:27 AM
#4
Re: How to catch a keyboard key?
Thanks but i have more then two forms and i don't want to define the Form_KeyDown routine in every form
I want that the main form will catch the key of its child forms.
-
January 11th, 2000, 08:04 AM
#5
Re: How to catch a keyboard key?
check out http://www.vbaccelerator.com/codelib...mr/hotkeyr.htm
It deals with registering application wide hotkeys.
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
|