How can I add a shortcut key to a menu item ?
(i.e. when I pressed CTRL+N a new window appears)
Thanks
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Alexandru LazarPosted Aug 1, 2010, 5:43 AM
Tanmay SarkarPosted Aug 1, 2010, 12:00 PM
private void Form1_Load(object sender, EventArgs e)
{
newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
}
Here " newToolStripMenuItem" is your menu strip item name.
I also upload a sample for your better under standing.
Previous ans is good i think.
please mark it as ans if it help you.