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

the keyboard to start a task

Status
Not open for further replies.

bvdv

Programmer
May 20, 2001
4
NL
I would like to make a program which executes tasks by pressing keys, but it seems only possible to make command buttons to click on whith the mouse. What are the commands for linking keys with tasks?
 
You can set the KeyPreview option on your main form to True and then keypresses anywhere in your application will be routed to the KeyPress on that form. There, you can use a Case-Select statement to determine what function to call. The other option is to use command buttons and use the & character in the name (i.e. &File = File) . . . that will allow keypresses to control you app, but in that case, the user will have to hold down the Alt key while pressing the other keys. - Jeff Marler B-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top