Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keys Help

Status
Not open for further replies.

Mukesh2375

Programmer
Jan 31, 2003
19
0
0
IN
is there any way in vb to check what was the last key pressed?
 
If you want to know the key that is pressed but just inside a form, it is easy: Set the KeyPreview property to True, and then in the Form_KeyPress event to have the parameter Keyascii with the code of the key that was pressed.
If you need keys like cursor keys and function keys and all the non printing keys, then use the Form_KeyDown event and in the KeyCode parameter you have the code of the key.

If you need to know what key is pressed, but in the entire system, then you need to install a hook.

Javier
.............
Javier
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top