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

# TOpenDialog.DoCanClose

Performs actions to determine if the dialog can be closed.

## Declaration

Source position: dialogs.pp line 256

`public procedure TOpenDialog.DoCanClose(`
`var CanClose: Boolean`
`); override;`

## Arguments

`CanClose` |  | Variable argument which indicates if the dialog can be closed.

## Description

DoCanClose is an overridden method in TOpenDialog. It ensures that a dialog using the classic style (where ofOldStyleDialog is included in Options) does not call the OnCanClose event handler in the inherited method. In this situation, the CanClose argument is set to True and the internal flag used in the execution loop is set indicating that DoCanClose was called.

This behavior is Delphi VCL compatible.

For Explorer-style dialogs (where ofOldStyleDialog is not included in Options), the inherited method is called. This allows the CanClose argument to be updated when the OnCanClose event handler is signalled.

## See also

TOpenDialog.Options |  | Options to be used for this dialog.
TCommonDialog.OnCanClose |  | Event handler signalled to determine if the dialog can be closed.
TOpenOption |  | Options which can be used in a TOpenDialog instance.