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

# TCommonDialog

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The base type from which other dialogs are derived.

## Declaration

Source position: dialogs.pp line 87

`type TCommonDialog = class(TLCLComponent)`
`protected`
`class procedure WSRegisterClass; override;` |  | Registers this component class with the current WidgetSet.
`function DoExecute; virtual;` |  | The function that actually takes care of executing the dialog.
`function DefaultTitle; virtual;` |  | DefaultTitle returns the default title for a dialog.
`function GetHeight; virtual;` |  | Gets the value for the Height property.
`function GetWidth; virtual;` |  | Gets the value for the Width property.
`procedure SetHeight(); virtual;` |  | Sets the value for the Height property.
`procedure SetWidth(); virtual;` |  | Sets the value for the Width property.
`procedure ResetShowCloseFlags;` |  | Resets the values in internal state flags for the dialog.
`property AttachTo: TCustomForm; [rw] platform ;` |  | Form which created the dialog class instance.
`property OnDialogResult: TDialogResultEvent; [rw] platform ;` |  | Event handler signalled when a result is available for the dialog.
`public`
`FCompStyle: LongInt;` |  | Internal member used to store component style flags.
`constructor Create(); override;` |  | Constructor for the class instance.
`function Execute; virtual;` |  | Displays the dialog and captures the result.
`property Handle: TLCLHandle; [rw]` |  | Contains the handle for the dialog form.
`property UserChoice: Integer; [rw]` |  | Contains the modal result value selected by the user.
`procedure Close; virtual;` |  | Closes the dialog and frees its resources.
`procedure DoShow; virtual;` |  | Performs actions needed when the dialog is displayed.
`procedure DoCanClose(); virtual;` |  | Performs actions needed to determine if the dialog can be closed.
`procedure DoClose; virtual;` |  | Performs actions needed when the dialog is closed.
`function HandleAllocated;` |  | Returns True if a widgetset Handle has been allocated for the dialog.
`property Width: Integer; [rw]` |  | The width of the dialog.
`property Height: Integer; [rw]` |  | The height of the dialog.
`published`
`property OnClose: TNotifyEvent; [rw]` |  | Event handler signalled when the dialog is closed.
`property OnCanClose: TCloseQueryEvent; [rw]` |  | Event handler signalled to determine if the dialog can be closed.
`property OnShow: TNotifyEvent; [rw]` |  | Event handler signalled when the dialog is displayed.
`property HelpContext: THelpContext; [rw]` |  | Help context identifier for the help message displayed for the dialog.
`property Title: TTranslateString; [rws]` |  | The Title or Caption displayed for the dialog.
`end;`

## Inheritance

`TCommonDialog` |  | The base type from which other dialogs are derived.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCommonDialog is the base type from which all other dialogs are derived.

Use Create to make an instance of the dialog, and the Execute method to show it to the user. Use the Close method to release it and free the used resources.