About menu items shortcuts

  • Thread starter Thread starter Yeghia Dolbakyan
  • Start date Start date
Y

Yeghia Dolbakyan

Hi Guys

Is it possible to display Custom Shortcut Keys for menu items. The standard
Property Page for menu items allows only selected shortcuts to choose. I
tried following text for menu item: "Process\tCtrl+Alt+P" but symbol '\t '

What you can suggest me
Thanks in advance

Regards
Yeghia
 
Yeghia,

To add the a for a shortcut to the menu item's caption you need to do 2
things:
1. Set in the property browser the menu item's ShowShortcut property to
*false*
2. Add the text for the shortcut to the menu item's caption. You have to use
an actual <tab> ASCII code to separate the menu item's name from its
shortcut.
AFAIK you cannot do that in the property browser, but you can do it from
code

menuItem.Text = "New\tCtrl+Alt+N";

Keep in mind that as long as you can set whatever text you want, the
shortcuts for the menu items has to one of the listed in the Shortcut enum
values, unless you don't do your own key handling.
 
Thanks Very Much for Your Help

Regards
Yeghia


Stoitcho Goutsev (100) said:
Yeghia,

To add the a for a shortcut to the menu item's caption you need to do 2
things:
1. Set in the property browser the menu item's ShowShortcut property to
*false*
2. Add the text for the shortcut to the menu item's caption. You have to
use an actual <tab> ASCII code to separate the menu item's name from its
shortcut.
AFAIK you cannot do that in the property browser, but you can do it from
code

menuItem.Text = "New\tCtrl+Alt+N";

Keep in mind that as long as you can set whatever text you want, the
shortcuts for the menu items has to one of the listed in the Shortcut enum
values, unless you don't do your own key handling.


--
Stoitcho Goutsev (100) [C# MVP]

Yeghia Dolbakyan said:
Hi Guys

Is it possible to display Custom Shortcut Keys for menu items. The
standard Property Page for menu items allows only selected shortcuts to
choose. I tried following text for menu item: "Process\tCtrl+Alt+P" but
symbol '\t '

What you can suggest me
Thanks in advance

Regards
Yeghia
 
Back
Top