Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

XtraDialog.Show(XtraDialogArgs) Method

Displays an XtraDialog with the specified settings.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v24.2.dll

NuGet Package: DevExpress.Win.Navigation

#Declaration

public static DialogResult Show(
    XtraDialogArgs args
)

#Parameters

Name Type Description
args XtraDialogArgs

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

#Returns

Type Description
DialogResult

A DialogResult enumerator value that specifies what dialog button an end-user has clicked.

#Remarks

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

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

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

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

Dialog - Showing args

See Also