Vcl.Forms.TCustomForm.ModalResult

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ModalResult: TModalResult read FModalResult write FModalResult;

C++

__property System::Uitypes::TModalResult ModalResult = {read=FModalResult, write=FModalResult, nodefault};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TCustomForm

Description

Represents the return value of a form that is used as a modal dialog.

Use ModalResult to close the form when it is displayed modally.

By default, ModalResult is mrNone. Set ModalResult to any nonzero value to close the form. The value assigned to ModalResult becomes the return value of the ShowModal function call used to display the form.

Note: This property is modified automatically by some components such as the TButton control.

Tip: If you call the Close method from a modal form, then ModalResult is automatically set to mrCancel.

See Also

Code Examples