I need to set shortcut Ctrl + "Plus Sign"
for one of the MenuStrip
menu item.
I prefer to set it NOT programmatically to have an help text block in the right side of menu item:
But I do not see there such variant to choose. Closest is "OemPlus"
I need to set shortcut Ctrl + "Plus Sign"
for one of the MenuStrip
menu item.
I prefer to set it NOT programmatically to have an help text block in the right side of menu item:
But I do not see there such variant to choose. Closest is "OemPlus"
Oemplus
is the right setting. If you don't like the text, change ShortcutKeyDisplayString
as well, e.g. to Ctrl++
Note that it is called OemPlus and not NumPlus, so does not work for the Numpad plus. Some people don't seem to know where the plus sign is and will try the Numpad plus.
If you need both, you need KeyPreview = true
and code:
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == (Keys.Control | Keys.Add))
{
MessageBox.Show("Ctrl+Numplus");
return true;
}
if (keyData == (Keys.Control | Keys.Oemplus))
{
MessageBox.Show("Ctrl+Oemplus");
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
The answer can be found in MSDN https://msdn.microsoft.com/en-us/library/ms171651(v=vs.110).aspx
To display custom shortcut keys for a menu command
Set the menu command's ShortcutKeyDisplayString property to the desired keyboard combination, such as CTRL+SHIFT+S
and set the ShowShortcutKeys
property to true.