Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Collapse]Editors and Simple Controls
    Templated ListBox Items
   [Collapse]Simple Editors
    [Expand]Included Components
    [Expand]Editors Structure
    [Collapse]Editors Features
      Text Editing Overview
     [Expand]Mask Editors Overview
     [Expand]Formatting and Parsing Values
     [Collapse]Editor Buttons Overview
       Editor Button Shortcuts
       Spin Buttons
     [Expand]Dropdown Editors Overview
      Image Editing Menu
     [Expand]Data Binding Overview
     [Expand]Appearance Customization
     [Expand]Miscellaneous Features
    [Expand]Member Tables
    [Expand]Examples
   [Expand]Lookup Editors
   [Expand]Token Edit Control
   [Expand]Breadcrumb Edit Control
   [Expand]Range Control
   [Expand]Image Slider
    Camera Control
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Editor Buttons Overview

ButtonEdit editors and descendants can display a number of buttons within their edit boxes. The ButtonEdit class introduces properties and events for management editor buttons. This topic provides general information on creating, customizing and using editor buttons.

Expanded Editor Buttons

Once a button editor (or descendant) has been placed on a form, you can access its button collection via the RepositoryItemButtonEdit.Buttons property. Clicking the ellipsis button corresponding to the Buttons property invokes the EditorButton Collection Editor dialog. This dialog manages the editor's button collection (i.e. add, remove buttons). Each button is represented by an EditorButton object and its properties can be accessed using the property grid.

The next image shows various editor button settings.

The table below lists all button settings illustrated and describes them briefly.

Property Description
EditorButton.Caption Specifies the text displayed by the editor button.
EditorButton.Enabled Specifies whether the editor button responds to user actions.
EditorButton.Image Specifies the image to be displayed in the button.
EditorButton.ImageLocation Specifies the image's alignment relative to the button's caption.
EditorButton.IsLeft Specifies the button's alignment within the edit box.
EditorButton.Kind Specifies the button's kind (the type of image to display in the button).
EditorButton.Width Specifies the button's width. If it is set to -1, the button width is calculated automatically based on the caption and image size.

You can hide a button by setting its EditorButton.Visible property to false.

In addition, the button's appearance can be customized using the EditorButton.Appearance property.

The editor buttons' paint style is specified by the repository item's RepositoryItemButtonEdit.ButtonsStyle property. This property value can be overridden by the style controller assigned to the editor. Please refer to the Border and Button Styles and Style Controller topics for additional information.

To respond to clicking buttons, handle the RepositoryItemButtonEdit.ButtonClick and RepositoryItemButtonEdit.ButtonPressed events. These events are also raised when pressing a button's associated shortcut. Please refer to the Editor Button Shortcuts topic for additional information.

Expanded Example - Creating a Button Editor at Runtime

The code below shows how to create and customize a button editor via code.

The following image shows the button editor created and customized using the code above.

Expanded See Also

How would you rate this topic?​​​​​​​