[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TCustomForm.ModalResult

Specifies the return value for a form (or dialog) displayed modally.

## Declaration

Source position: forms.pp line 790

`public property TCustomForm.ModalResult : TModalResult read FModalResult write SetModalResult;`

## Description

ModalResult is a TModalResult property which contains the value derived when the form is displayed modally. Setting a new value for the property causes the widgetset class to be notified when a handle has been allocated for the form.

The value in ModalResult is updated when the ShowModal method is called for the form instance. It is updated in the CloseModal method when CloseQuery is False and CloseAction is caNone. Finally, it is set to mrCancel in the Close method when FormState contains the value fsModal.

See TModalResult for more information about the enumeration values and their meanings.

## See also

TModalResult |  | Dummy type for the values that can be returned as a modal result.
TCustomForm.ShowModal |  | Displays the form as a modal dialog.
TCustomForm.Close |  | Closes the form.
TCustomForm.FormState |  | State flags for the form.
TCustomForm.CloseQuery |  | Asks the OnCloseQuery handler whether the form can be closed.