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

XtraMessageBox.Show(XtraMessageBoxArgs) Method

Displays an XtraMessageBox with the specified settings.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v19.1.dll

Declaration

public static DialogResult Show(
    XtraMessageBoxArgs args
)

Parameters

Name Type Description
args DevExpress.XtraEditors.XtraMessageBoxArgs

An XtraMessageBoxArgs object that allows you to dynamically customize the displayed dialog.

Returns

Type Description
DialogResult

A DialogResult enumerator value that specifies which message box button an end-user has clicked.

Remarks

You can handle the Showing event for the args parameter to dynamically customize the message box content and buttons. The code below illustrates an example.


XtraMessageBoxArgs args = new XtraMessageBoxArgs();
args.Showing += Args_Showing;
args.Caption = "Default Text";
args.Buttons = new DialogResult[] { DialogResult.OK, DialogResult.Cancel };
XtraMessageBox.Show(args);

//...
private void Args_Showing(object sender, XtraMessageShowingArgs e) {
    e.Form.Text = "Custom Text";
    e.Buttons[DialogResult.OK].Text = "Yes";
    e.Buttons[DialogResult.Cancel].Text = "No";
}

As a result, the displayed message box will have content and button captions that differ from those that were initially set.

Dialog - Showing args

See the XtraMessageBox article for more examples.

See Also