We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Platform : Windows Forms
|
Category : Menus

How do I add shortcuts that are not in the Shortcuts enum to my menu item?

To customize the shortcut (which are not present in the System.Windows.Forms.Shortcut Enum), you need to override the ProcessCmdKey event of the form and handle the needed keys. The below example has a menu item with name “item” and the shortcut Ctrl + Alt + 0 has been set by handling the ProcessCmdKey event. The Click event of the menu item is simulated. Instead of MenuItem, you can utilize ToolStripMenuItem which has plenty of features and all kind of shortcuts are available.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.