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

EditorButton(ButtonPredefines, String, Int32, Boolean, Boolean, Boolean, HorzAlignment, Image, KeyShortcut) Constructor

Initializes a new EditorButton instance with the specified property values.

Namespace: DevExpress.XtraEditors.Controls

Assembly: DevExpress.XtraEditors.v19.2.dll

Declaration

public EditorButton(
    ButtonPredefines kind,
    string caption,
    int width,
    bool enabled,
    bool visible,
    bool isLeft,
    HorzAlignment imageAlignment,
    Image image,
    KeyShortcut shortcut
)

Parameters

Name Type Description
kind ButtonPredefines

The value to initialize the button’s EditorButton.Kind property.

caption String

A String value which specifies the button’s caption. This value is assigned to the EditorButton.Caption property.

width Int32

An integer value specifying the button’s width. This value is assigned to the EditorButton.Width property.

enabled Boolean

The value to initialize the button’s EditorButton.Enabled property.

visible Boolean

The value to initialize the button’s EditorButton.Visible property.

isLeft Boolean

The value to initialize the button’s EditorButton.IsLeft property.

imageAlignment HorzAlignment

The value to initialize the button’s EditorButton.ImageLocation property.

image Image

The value to initialize the button’s EditorButton.Image property.

shortcut KeyShortcut

The value to initialize the button’s EditorButton.Shortcut property.

Remarks

The constructor allows you to create a button with the specified property values. After the button is created, you can add it to the button collection of a ButtonEdit control. For this purpose, use the EditorButtonCollection.Add method accessible via the RepositoryItemButtonEdit.Buttons property.

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