All docs
V21.2
21.2
21.1
20.2
20.1
19.2
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

XtraBaseArgs.DefaultButtonIndex Property

Gets or sets the index of a button from the Buttons collection that is a default button. A default button is initially focused and is considered clicked when user presses Enter or the auto-close timer expires (see AutoCloseOptions).

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v21.2.dll

Declaration

public int DefaultButtonIndex { get; set; }

Property Value

Type Description
Int32

The index of a default button.

Remarks

The code below shows the XtraInputBox with “OK”, “Cancel” and “Retry” buttons. The “Retry” button is a default button - if a user presses Enter when the input box is shown, the input box closes and returns DialogResult.Retry.

XtraInputBoxArgs xia = new XtraInputBoxArgs();
(xia as XtraBaseArgs).Buttons = new DialogResult[] {
    DialogResult.OK, DialogResult.Cancel, DialogResult.Retry };
xia.DefaultButtonIndex = 2;
xia.Caption = "User not found. Enter a valid user name.";
XtraInputBox.Show(xia);
See Also