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

# TFileNameEdit.CreateDialog

Creates the dialog for the control.

## Declaration

Source position: editbtn.pas line 388

`protected function TFileNameEdit.CreateDialog(`
`AKind: TDialogKind`
`):TCommonDialog; virtual;`

## Arguments

`AKind` |  | Identifies the dialog kind or type created in the method.

## Function result

Dialog class instance created in the method.

## Description

CreateDialog is a TCommonDialog function which creates and returns the dialog for the grouped edit control.

AKind contains the TDialogKind value that identifies the dialog type required for the control, and normally has the value from the DialogKind property. AKind determines the class type instantiated and used as the return value. For example:

dkOpen
  TOpenDialog is the type in return value.
dkPictureOpen
  TOpenPictureDialog is the type in return value.
dkSave, dkPictureSave
  TSaveDialog is the type in return value.

Properties relevant to the dialog kind are copied into the dialog, and may include:

- FileName
- Path information extracted from FileName
- InitialDir
- DefaultExt
- Filter
- FilterIndex
- DialogOptions
- DialogTitle

For an open dialog, path information in FileName is retained if the path is valid. This causes use of InitialDir to be disabled in the dialog. If the path in Filename is invalid, only the base file name and extension are copied to the dialog. An explicit value in InitialDir is resolved (cleaned and expanded) when valid, and stored to the dialog. Otherwise, the initial directory is determined by the widgetset when the dialog is executed.

CreateDialog is used in the implementation of the RunDialog method.

## See also

TFileNameEdit.DefaultExt |  | Default file extension used in the dialog for the component.
TFileNameEdit.DialogOptions |  | DialogOptions - set of options enabled for the file open dialog.
TFileNameEdit.DialogTitle |  | DialogTitle - the title to appear on the dialog.
TFileNameEdit.FileName |  | FileName - the name of the selected file: either the initial value placed in the Text Box, or the value selected from the dialog.
TFileNameEdit.Filter |  | Filter - the filtering string to help search for the required file.
TFileNameEdit.FilterIndex |  | FilterIndex - index value for the filtering string.
TFileNameEdit.InitialDir |  | Initial directory displayed when the dialog is executed for the control.
TFileNameEdit.RunDialog |  | Executes an Open or Save dialog for the DialogKind specified in the control.
TCommonDialog |  | The base type from which other dialogs are derived.
TOpenDialog |  | Implements a File / Open dialog used to select one or more files on the local file system.
TSaveDialog |  | TSaveDialog - Dialog for saving the current buffer to a file.
CleanAndExpandDirectory