Skip to main content
A newer version of this page is available. .

EditorButton Class

Represent an individual editor button displayed in a ButtonEdit control or descendant.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v19.1.dll

Declaration

public class EditorButton :
    IDisposable,
    ICaptionSupport,
    ISupportCommandBinding

The following members return EditorButton objects:

Remarks

The ButtonEdit editor and all editors derived from it allow you to display an unlimited number of buttons within the editor box. The collection of buttons displayed by an editor is available via the RepositoryItemButtonEdit.Buttons property. This property provides access to a collection object whose members can be used to add, delete and access individual buttons. Each individual button is represented by an EditorButton object. Such objects provide a number of settings specifying the button’s appearance, associated shortcut, visibility, tooltip, etc.

Note: editor buttons do not provide their own events allowing you to handle button clicks. To respond to clicking or pressing an editor button, you should handle the RepositoryItemButtonEdit.ButtonClick and RepositoryItemButtonEdit.ButtonPressed events respectively. These events provide an EditorButton object as the parameter which can be used to identify which button was affected.

Example

The following code creates a button edit control and places it onto a panel1 panel. The code changes default button kind (ellipsis) into ButtonPredefines.OK and adds another button (ButtonPredefines.Delete) to the button’s collection.

The result of code execution is displayed below:

ButtonEdit1_creating_example.gif

  ButtonEdit btnEdit1 = new ButtonEdit();
  btnEdit1.Width = 100;
  btnEdit1.Properties.Buttons[0].Kind = ButtonPredefines.OK;
  btnEdit1.Properties.Buttons.Add(new EditorButton(ButtonPredefines.Delete));
  panel1.Controls.Add(btnEdit1);

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the EditorButton class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

See Also