How can I add a shortcut key to a menu item ?
(i.e. when I pressed CTRL+N a new window appears)
Thanks
Shortcut key
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Alexandru Lazar12 reputationPosted Aug 1, 2010, 1:43 AM EDT
Tanmay SarkarRank #1,407 · 1.2K reputationPosted Aug 1, 2010, 8:00 AM EDT
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.