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

# TCommonDialog.DoCanClose

Performs actions needed to determine if the dialog can be closed.

## Declaration

Source position: dialogs.pp line 125

`public procedure TCommonDialog.DoCanClose(`
`var CanClose: Boolean`
`); virtual;`

## Arguments

`CanClose` |  | True if the OnCanClose event handler determines the dialog can be closed.

## Description

DoCanClose is a method which determines if the dialog can be closed. It updates an internal flag which indicates the method has been called, and signals the OnCanClose event handler (when assigned and supported for the platform).

Use the OnCanClose to implement any required logic to determine if the dialog can actually be closed. The value in the CanClose argument is updated in the event handler.

DoCanClose is called from the DoExecute method when the widgetset class has attempted to close the dialog.

## See also

TCommonDialog.OnCanClose |  | Event handler signalled to determine if the dialog can be closed.
TCommonDialog.Execute |  | Displays the dialog and captures the result.
TCommonDialog.DoExecute |  | The function that actually takes care of executing the dialog.