Skip to main content
All docs
V19.1

Editor Button Shortcuts

  • 2 minutes to read

As described in the Editor Buttons Overview topic, ButtonEdit editors and their descendants can display a number of buttons within their edit boxes. Each button’s functionality can be invoked by clicking a button or by pressing the associated shortcut. In these cases, an editor raises its RepositoryItemButtonEdit.ButtonClick event. Handle this event to specify the button’s action. Note: pressing the shortcut and holding it pressed will auto repeat. The RepositoryItemButtonEdit.ButtonPressed event is not raised when using button shortcuts.

 

To specify a shortcut, use the button’s EditorButton.Shortcut property. The following image shows how to do this at design time.

EditorButton_Collection_Editor_shortcut

As shown in the image above, once the combo box’s button is pressed, a dropdown containing predefined key combinations is displayed. You can then select one of the predefined values, or specify a custom shortcut using the (custom) item. The (custom) item invokes the Shortcut Editor dialog. Use this dialog to specify the desired key combination by pressing it.

ShortcutEditor

These actions can be performed programmatically. The following sample code shows how to assign the CTRL+SHIFT+H and CTRL+L shortcuts to editor buttons.


buttonEdit1.Properties.Buttons[0].Shortcut = new KeyShortcut(Keys.Control | Keys.L);
buttonEdit1.Properties.Buttons[1].Shortcut = new KeyShortcut(Keys.Control | Keys.Shift | Keys.H);

Note

The assigned shortcuts are only in effect when the editor has focus.

See Also