Using Shortcut Keys in Toolbar Control 
Author Message
 Using Shortcut Keys in Toolbar Control

Does anyone know how to make the shortcut keys work on the Toolbar control?
I have a toolbar button with the Caption set to &New, but Alt-N does not
execute the code.

Thanks!



Tue, 24 Jul 2001 03:00:00 GMT  
 Using Shortcut Keys in Toolbar Control
The convention in Windows is to have the ALT key combinations access
top-level menus, not toolbars. You users will probably be confused if you
change the convention. You should have a New option in your menus, and you
can assign a shortcut to that (e.g. CTRL-N). That shortcut will then
activate the New functionality, and will have the same effect as if the
shortcut was attached to the toolbar.

Toolbars are intended to be a speedier alternative to menus for expert
users, not a replacement for them.

Colin

Quote:

>Does anyone know how to make the shortcut keys work on the Toolbar control?
>I have a toolbar button with the Caption set to &New, but Alt-N does not
>execute the code.

>Thanks!



Tue, 24 Jul 2001 03:00:00 GMT  
 Using Shortcut Keys in Toolbar Control
I understand everything that you are saying.  Actually, I just wrote New as
an example of a button.  I have a collegue who asked me if this can be done,
so I figured I'd ask.

If VB lets me put the &New in my caption, then it should also use the
shortcut.  Is it my understanding that your answer means you can't have an
Alt-Key associated with a toolbar??


Quote:
>The convention in Windows is to have the ALT key combinations access
>top-level menus, not toolbars. You users will probably be confused if you
>change the convention. You should have a New option in your menus, and you
>can assign a shortcut to that (e.g. CTRL-N). That shortcut will then
>activate the New functionality, and will have the same effect as if the
>shortcut was attached to the toolbar.

>Toolbars are intended to be a speedier alternative to menus for expert
>users, not a replacement for them.

>Colin



Tue, 24 Jul 2001 03:00:00 GMT  
 Using Shortcut Keys in Toolbar Control
I forgot to mention something....have you been to Outlook 98 recently?  They
have toolbar buttons that have the Alt-key capabilities enabled.  So,
standard or not?  Microsoft is not consistent with this feature.


Quote:
>The convention in Windows is to have the ALT key combinations access
>top-level menus, not toolbars. You users will probably be confused if you
>change the convention. You should have a New option in your menus, and you
>can assign a shortcut to that (e.g. CTRL-N). That shortcut will then
>activate the New functionality, and will have the same effect as if the
>shortcut was attached to the toolbar.

>Toolbars are intended to be a speedier alternative to menus for expert
>users, not a replacement for them.

>Colin




Quote:
>>Does anyone know how to make the shortcut keys work on the Toolbar
control?
>>I have a toolbar button with the Caption set to &New, but Alt-N does not
>>execute the code.

>>Thanks!



Tue, 24 Jul 2001 03:00:00 GMT  
 Using Shortcut Keys in Toolbar Control

Quote:
>The convention in Windows is to have the ALT key combinations access
>top-level menus, not toolbars. You users will probably be confused if you
>change the convention. You should have a New option in your menus, and you
>can assign a shortcut to that (e.g. CTRL-N). That shortcut will then
>activate the New functionality, and will have the same effect as if the
>shortcut was attached to the toolbar.

If this answer is correct, then why does prefixing any letter belonging to a
toolbar icon with ampersand (&) cause that letter to be underlined?


Wed, 25 Jul 2001 03:00:00 GMT  
 Using Shortcut Keys in Toolbar Control
The toolbar control (at least the VB incarnation) does not do accelerator
translation like the menus do. What most apps do is setup toolbar commands
that duplicate the functionality on the menus, and translate a toolbar
click into a menu click. Of course, if you don't want to have menus on the
form, you'll have to "fake" the accelerators by setting up a key mapping
routine that responds to the form's KeyDown and KeyUp events (make sure
the KeyPreview property of the form is set to true).

As for Outlook and standards, IMO the point is moot, because Outlook's
menus are not menus and the toolbars are not toolbars (in the sense that
we are used to, i.e., the common controls and VB's standard menus).
Rather, the new Office "CommandBars" are a mix between a menu and a rebar.
The jury is out on whether users feel comfortable with them, though.

~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please post/reply to the newsgroup(s) so
that everyone can benefit from the discussion.

Regards,

Klaus H. Probst, MCP


       ICQ: 22454937
      The VB Box: http://members.xoom.com/kprobst/
~~~~~~~~~~~~~~~~~~~~~~~~~~~


Quote:
> Does anyone know how to make the shortcut keys work on the Toolbar
control?
> I have a toolbar button with the Caption set to &New, but Alt-N does not
> execute the code.

> Thanks!



Wed, 25 Jul 2001 03:00:00 GMT  
 Using Shortcut Keys in Toolbar Control
Klaus,

I appreciate your response.  I was not looking for UI help here, but just
how technically to do it.  Personally, I don't get confused when I see
shortcuts on the Outlook "toolbar".  When I see a letter underlined, I
automatically assume that the Alt-key combo for that letter will work.  This
IS the case in Outlook 98.  I wish the VB menus/toolbars would catch up to
the newer Microsoft programs as far as functionality goes.  It is misleading
to allow me to create a caption in my toolbar for the underline, but not
have it work.



Fri, 27 Jul 2001 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Alt-Shortcut key with Toolbar?

2. WebBrowser control shortcut keys & function keys

3. WebBrowser control shortcut keys & function keys

4. Accessing toolbar throgh shortcut keys

5. inserting formated text at any location by using shortcut keys

6. Inadvertently bypassing LostFocus event by using shortcut key combo to click another button

7. Keyboard shortcuts on Toolbar control?

8. Keyboard shortcuts on Toolbar control?

9. Shortcut keys to access controls/fields

10. shortcut keys don't work while my active control is the datagrid

11. Problems with Shortcut Keys in ActiveX Control

12. Problems with Shortcut Keys in ActiveX Control

 

 
Powered by phpBB® Forum Software