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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keystroke Actions

Status
Not open for further replies.

peter11

Instructor
Mar 16, 2001
334
US
How can you make a specific action occur upon the press of a specific key on the keyboard?
 
There is a KeyPress event that is raised when... well.. a key is pressed. =) You might try something like this...
Code:
' select the KeyPress event for the control from the 
' combo boxes on the code form
private sub Text1_KeyPress (KeyAscii as Integer)
Char = Chr(KeyAscii)
If Char = <whatever> Then
  <do stuff>
End If
KeyAskcii = <whatever you what to show up in the textbox>
End Sub

~Melissa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top