KeyCode

Is there a way to find the KeyCode when we don't know where is the focus. I don't want to use SetFocus. I just want to catch the KeyCode Anytime.
If it is possible without Api i'd like?
LVL 1
dosylAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Sage020999Connect With a Mentor Commented:
Ok,  turn on your keypreview for the form.  This will send the keypreview property of the form.  This will force the keys to affect the form and not the controls on the form.  You can then validate the keys in the Keyup or Keydown events to involk the differant responses you wish to create.
0
 
Sage020999Commented:
Are you talking about monitoring which keys are pressed in your app?  You can turn on the keypreview for the form.  
0
 
dosylAuthor Commented:
I want to verify for example:
If the user press Delete, i will delete the info. on the form. Etc.
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
dosylAuthor Commented:
Info.= Data in txtboxes, data in the recordset etc.
0
 
korkyCommented:
Use the GetAsyncKeyState() API


0
 
dosylAuthor Commented:
I forgot this property.
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.