I want to be able to show the hotkey combination assigned to a toolstrip menu item in winforms. For instane, in any program (even your browser settings menu) you can see various menu items, and generally, aligned to the right of their item, is their hotkey shortcut. I want to do this programmatically.
Example: Instead of typing
Open a file (ctrl+O)
I want to have the properties show up independently of each other.
How can I achieve this?
Set Shortcut Keys for Menu ItemsSelect the Edit menu item and select its ShortcutKeys property in the properties window. Click the drop down button next to it. Select Ctrl as Modifier and E as the key.
You want to you use the ShortcutKeys property of the ToolStripMenuItem. This will let you pick the particular key combination you want for each menu item and it will show up to the right of the menu item. Make sure that you have ShowShortcutKeys property of the ToolStripMenuItem set to true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With