All docs
V20.1
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.AutoCloseOptions Property

Provides access to settings that allow the shown object (XtraMessageBox, XtraInputBox, etc.) to automatically close after a certain delay.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v20.1.dll

Declaration

public AutoCloseOptions AutoCloseOptions { get; }
Public ReadOnly Property AutoCloseOptions As AutoCloseOptions

Property Value

Type Description
AutoCloseOptions

Provides access to auto-close settings.

Remarks

The code below utilizes the AutoCloseOptions.Delay to make the XtraMessageBox automatically close 5 seconds after it was shown.


XtraMessageBoxArgs args = new XtraMessageBoxArgs();
 args.AutoCloseOptions.Delay = 5000;
 args.AutoCloseOptions.ShowTimerOnDefaultButton = true;
 args.Caption = "Auto-close message";
 args.Text = "This message closes automatically after 5 seconds.";
 args.Buttons = new DialogResult[] { DialogResult.OK, DialogResult.Cancel};
 XtraMessageBox.Show(args).ToString();

The first message box button ("OK" in the sample above) is a default button - if a user presses "Enter" or the auto-closing timer expires, this button is considered clicked, and the message box returns the corresponding DialogResult value. This button also displays the countdown timer for auto-closing messages.

MessageBox - CountDown

You can modify the XtraMessageBoxArgs.DefaultButtonIndex to select the default button and disable the AutoCloseOptions.ShowTimerOnDefaultButton setting to hide the countdown timer.


// change the default button
 args.DefaultButtonIndex = 1;
// set to false to hide the countdown
args.AutoCloseOptions.ShowTimerOnDefaultButton = false;
See Also