FMX.Forms.TCommonCustomForm.OnCloseQuery

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnCloseQuery: TCloseQueryEvent read FOnCloseQuery write FOnCloseQuery;

C++

__property TCloseQueryEvent OnCloseQuery = {read=FOnCloseQuery, write=FOnCloseQuery};

Properties

Type Visibility Source Unit Parent
event public
FMX.Forms.pas
FMX.Forms.hpp
FMX.Forms TCommonCustomForm

Description

Occurs when there is an attempt to close the form.

Use OnCloseQuery to specify the conditions under which the form can close. An OnCloseQuery event handler returns a Boolean CanClose value that determines whether a form is allowed to close. Its default value is True.

You can use an OnCloseQuery event handler to ask users whether they are sure they want the form closed immediately. For example, you can use the handler to display a message box that prompts the user to save a file before closing the form.

The TCloseQueryEvent type points to the method that determines whether a form can be closed. The value of the CanClose parameter determines whether the form can be closed or not.

See Also