Entering hotkey / shortcut text next to toolbar menu items in winforms

I want to show a combination of hot keys assigned to a dashboard menu item in winforms. For instane in any program (even in the settings menu of your browser) you can see various menu items and, as a rule, aligned to the right of their element, is a shortcut to their hot keys. I want to do this programmatically.

Example: instead of typing

Open a file (ctrl+O) 

I want the properties to be displayed independently of each other.

How can i achieve this?

+8
c # winforms keyboard-shortcuts hotkeys
source share
1 answer

You want to use the ShortcutKeys property of the ToolStripMenuItem object. This will allow you to select the specific key combination that you want for each menu item, and it will be displayed to the right of the menu item. Verify that the ShowShortcutKeys property of the ToolStripMenuItem is set to true.

+7
source share

All Articles