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

# TCommonDialog

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

TCommonDialog : the base type from which other dialogs are derived

## Declaration

Source position: dialogs.pp line 63

`type TCommonDialog = class(TLCLComponent)`
`protected`
`procedure WSRegisterClass; override;` |  | WSRegisterClass - Register this Class for the current Widget Set
`function DoExecute; virtual;` |  | The function that actually takes care of executing the dialog
`function DefaultTitle; virtual;` |  | DefaultTitle - returns the default title for a dialog
`public`
`FCompStyle: LongInt;` |  | FCompStyle - local variable holding the style
`constructor Create(); override;` |  | Create - constructor for TCommonDialog: calls inherited Create and adds default Title
`function Execute; virtual;` |  | A public method causing the dialog box to appear, offer the relevant choices to the user and act upon the choice
`property Handle: THandle; [rw]` |  | Operating system Handle for the dialog
`property UserChoice: Integer; [rw]` |  | UserChoice - the value selected by the user
`procedure Close; virtual;` |  | Close the dialog and return the memory used
`procedure DoShow; virtual;` |  | DoShow - the procedure that actually takes care of showing the dialog box
`procedure DoCanClose(); virtual;` |  | DoCanClose - software emulation of the OnCanClose event
`procedure DoClose; virtual;` |  | DoClose - software emulation of the OnClose event
`function HandleAllocated;` |  | HandleAllocated - returns True if a handle has been allocated
`published`
`property OnClose: TNotifyEvent; [rw]` |  | Event Handler for closing the dialog
`property OnCanClose: TCloseQueryEvent; [rw]` |  | Event Handler when dialog is able to be closed
`property OnShow: TNotifyEvent; [rw]` |  | Event handler for showing the dialog
`property HelpContext: THelpContext; [rw]` |  | HelpContext - an index to the context-dependent help message for this dialog
`property Width: Integer; [rw]` |  | The width of the dialog box
`property Height: Integer; [rw]` |  | The height of the dialog box
`property Title: String; [rws]` |  | The Title or Caption to be shown at the top of the dialog box
`end;`

## Inheritance

`TCommonDialog` |  | TCommonDialog : the base type from which other dialogs are derived
`TLCLComponent`
?
`TObject`

## Description

TCommonDialog: the base type from which all other dialogs are derived.
Use the "Create" method to make an instance of the dialog,
the "Execute" method to show it to the user
and the "Close" method to release it and free the used resources.

The latest version of this document can be found at lazarus-ccr.sourceforge.net.