From RAD Studio API Documentation
Jump to: navigation, search


property OnCanClose: TCloseQueryEvent read FOnCanClose write FOnCanClose;


__property Fmx::Forms::TCloseQueryEvent OnCanClose = {read=FOnCanClose, write=FOnCanClose};


Type Visibility Source Unit Parent
event published
FMX.Dialogs TOpenDialog


Occurs when the user tries to close the dialog.

Write an OnCanClose event handler to provide custom validation of the value of FileName. File selection dialogs provide a number of built-in validations, such as checking for invalid characters, prompting for confirmation before overwriting, checking whether a file or path exists, and so on. These validations can be specified using the Options property. However, applications can provide additional validation of file names in an OnCanClose event handler.

Set the CanClose parameter to False to prevent the dialog from closing. The OnCanClose event handler is responsible for telling the user why the dialog doesn't close.

See Also