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

BaseButton.DialogResult Property

Gets or sets a value that is returned to the parent form when the button is clicked.

Namespace: DevExpress.XtraEditors

Assembly: DevExpress.XtraEditors.v18.2.dll

Declaration

[DXCategory("Behavior")]
[DefaultValue(DialogResult.None)]
public DialogResult DialogResult { get; set; }

Property Value

Type Default Description
DialogResult **None**

A DialogResult enumeration member specifying the value that is returned to the parent form when the button is clicked.

Remarks

The DialogResult property implements the IButtonControl interface’s DialogResult property. If this property value is set to anything other than DialogResult.None and the parent form was displayed by the ShowDialog method, clicking the button closes the parent form without hooking up any events. The form’s DialogResult property is then set to the DialogResult of the button when the button is clicked.

For example, to create a “Yes/No/Cancel” dialog, simply add three buttons and set their DialogResult properties to DialogResult.Yes, DialogResult.No and DialogResult.Cancel.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DialogResult property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also