I am working on an application that has a Menu on top of it. I want to use a different method for shortcut keys (being this snippet): this is for shortcut key: CTRL + N, 1
bool prefixSeen = false;
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (prefixSeen)
{
switch (keyData)
{
case (Keys.Control | Keys.D1):
MessageBox.Show("New file");
prefixSeen = false;
break;
}
}
switch (keyData)
{
case (Keys.Control | Keys.n):
prefixSeen = true;
break;
}
return base.ProcessCmdKey(ref msg, keyData);
}
Code taken from here.
Here is my menu:
And I want in menu items to be displayed (aligned on the right) the shortcut key (that should just be interpreted as a string I think). How can I achieve this effect?
Thanks in advance, and a Happy New Year to every one.
Edit: the built-in method for Visual Studio is: