Description

Gets or sets the dialog result for the form.

Syntax

DialogResult [ = Long ]

Property Value

A DialogResult that represents the result of the form when used as a dialog box.

Remarks

The dialog result of a form is the value that is returned from the form when it is displayed using the ShowDialog method. If the form is displayed as a dialog, setting this property with a value from the DialogResult enumeration sets the value of the dialog result for the form, hides the modal dialog, and returns control to the calling form.

This property is typically set by the DialogResult property of a Button control on the form. When the user clicks the Button control, the value assigned to the DialogResult property of the Button is assigned to the DialogResult property of the form.

When a form is displayed as a modal dialog box, clicking the Close button (the button with an X in the top-right corner of the form) causes the form to be hidden and the DialogResult property to be set to DialogResult.Cancel.


The CHM file was converted to HTML by chm2web software.