About menu items shortcuts

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
 
S

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

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.
 
Y

Yeghia Dolbakyan

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top