EditorButton Class

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

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

public class EditorButton :
    IDisposable,
    ICaptionSupport,
    ISupportCommandBinding
Public Class EditorButton
    Implements IDisposable,
               ICaptionSupport,
               ISupportCommandBinding

Related API Members

The following members accept/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.

Examples

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);

Inheritance

See Also