We use the System.Windows.Forms.Shortcut enum which does not include that in the enum. So to get something like this to happen you can handle the forms KeyDown and check the keys and then do a call to a function that does the same code that the button click would have done.
For instance:
private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Tab && e.Control && e.Shift) { //perform the action you like MyButtonToolClickCode(); } } private void MyButtonToolClickCode() { // MyButton ToolClick code } private void ultraToolbarsManager1_ToolClick(object sender, ToolClickEventArgs e) { if (e.Tool.Key == "ButtonTool1") { MyButtonToolClickCode(); } }
It works but how to show shortcut keys combination right-aligned in the context menu?
You cannot set the shortcut text manually. This is taken directly from the Shortcut of the tool. However, you can set the Shortcut of the tool to Ctrl+Shift+Tab even though the enum doesn't have that member. The Shortcut enum values correspond to the Keys enum values, so you can just construct the shortcut with the keys involved:
buttonTool.SharedProps.Shortcut = (Shortcut)(Keys.Control | Keys.Shift | Keys.Tab);
Just so you know though, the Ctrl+Shift+Tab shortcut is usually defined for navigating between toolbars. If you have multiple toolbars, hit the Alt key to give the main menu toolbar focus. Then hit Ctrl+Tab or Ctrl+Shift+Tab to shift focus to another toolbar. Using the shortcut will not cause any problems, but the user will no longer be able to use that shortcut to navigate the toolbars.