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

# TDirectoryEdit.CreateDialog

Creates and configures the dialog for the control.

## Declaration

Source position: editbtn.pas line 496

`protected function TDirectoryEdit.CreateDialog: TCommonDialog; virtual;`

## Function result

Dialog created and configured in the method.

## Description

CreateDialog is a TCommonDialog function which creates and configures the Directory Open dialog executed when the Button is clicked for the control. In TDirectoryEdit, the class type instantiated and used as the return value is actually TSelectDirectoryDialog.

CreateDialog ensures that values for the InitialDir and FileName properties in the dialog are set using the properties in the class instance. Directory and Filename are used in the dialog when the directory exists on the local file system. Otherwise, the initial directory is set to the value in RootDir and the file name is set to the value in Directory.

CreateDialog set the options in the dialog to the values specified in DialogOptions, and the value in DialogTitle is used as the title for the dialog.

CreateDialog is used in the implementation of the RunDialog method.

## See also

TDirectoryEdit.Directory |  | The Directory selected by the dialog.
TDirectoryEdit.RootDir |  | The root directory for file system navigation in the control.
TDirectoryEdit.DialogOptions |  | Contains the options enabled for the Open dialog displayed by the control.
TDirectoryEdit.DialogTitle |  | DialogTitle - the title that appears on the Select Directory dialog.
TSelectDirectoryDialog |  | Implements a select directory dialog.
TCommonDialog |  | The base type from which other dialogs are derived.