TFileDialog.DoCanClose procedure
Performs actions needed to determine if the dialog can be closed.
Declaration
procedure DoCanClose(var CanClose: Boolean); overrideArguments
CanClose | Contains True if the dialog can be closed. False to prevent the dialog from being closed. |
Description
DoCanClose is an overridden method in
TFileDialog used
to perform actions needed when an attempt is made to close the dialog. It
ensures that the inherited method is called only when the OK button was
pressed on the dialog. If the Esc key was pressed, or the dialog is closed
using the close icon, the inherited method is
not called. This
prevents the OnCanClose event from being signalled when the dialog has
actually been cancelled. CanClose is set to
True in this situation.
This is done to maintain compatibility with Delphi VCL behavior.
Use the OnCanClose event handler to perform validation or error checking needed for the value in FileName. Set the value in its CanClose argument to False to prevent closing the dialog form.
See also
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
