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

Hotkeys on Toolbar Buttons 1

Status
Not open for further replies.

SnyAc

Programmer
Jul 25, 2001
272
US
I'm using a toolbar and would like to be able to use the keyboard hotkeys to click the buttons.... doesn't seem to be working like usual, but I guess that's probably because it's a toolbar. Anybody have a solution or an idea?

Thanks...

Andy Snyder
SnyAc Software Services
 
Create a menu that uses the hotkeys to active the same functionality. The menu doesn't need to be visible, just in memory.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Another way is to do an On Key Label for each button in your toolbar.

***Toolbar Button Init()
ON KEY LABEL ALT+F1 Do Form <<myform>>
 
To elaborate: For the toolbar “Hot-Keys” the same rules that apply for menus should be followed. In other words you would not use “C” to start a Customer Form, but rather an ALT+C. etc.
For toolbars as they never get the focus(), its not possible to create “true” hot keys even though the help says you can by setting the Picture Position to 14. You can only do this by setting On Key Label.

Try this in the Init() of the tool bar button

ON KEY LABEL ALT+C Do Form myform
 
IMO, the best way is to display a menu that has the hot keys on it so the user knows what key to use.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top