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

# TCommonDialog.Execute

Displays the dialog and captures the result.

## Declaration

Source position: dialogs.pp line 120

`public function TCommonDialog.Execute: Boolean; virtual;`

## Function result

Returns True if the user pressed the OK button.

## Description

Use the Execute method to display the dialog and capture the result.

Execute notifies the Application that a modal display is started, and disables the current form. The widgetset handle is allocated for the dialog, and the DoExecute method is called to process the modal dialog. The form is re-enabled and its active control is re-selected. The Application is notified that the modal display is completed.

The return value is set to True if the OK button was pressed to exit the dialog.

## See also

TCommonDialog.DoExecute |  | The function that actually takes care of executing the dialog.
Application |  | The TApplication singleton.
TApplication.ModalStarted |  | Called when a modal form display is started.
TApplication.ModalFinished |  | Called when a modal form is closed.