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

# TFileDialog

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

TFileDialog allows selection of a file from the current directory.

## Declaration

Source position: dialogs.pp line 141

`type TFileDialog = class(TCommonDialog)`
`protected`
`class procedure WSRegisterClass; override;` |  | Registers this component class with the current WidgetSet.
`function GetFilterIndex; virtual;` |  | Gets the value for the FilterIndex property.
`procedure SetFileName(); virtual;` |  | Set the value for the FileName property.
`procedure SetFilter(); virtual;` |  | Sets the value for the Filter property.
`procedure SetHistoryList(); virtual;` |  | Sets the value for the HistoryList property.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`procedure DoCanClose(); override;` |  | Performs actions needed to determine if the dialog can be closed.
`procedure DoTypeChange; virtual;` |  | Performs actions needed when the value in FilterIndex has been changed.
`property Files: TStrings; [r]` |  | Stores the names of files (or directories) selected using the dialog.
`property HistoryList: TStrings; [rw]` |  | HistoryList - stringlist containing the names of files recently accessed.
`procedure IntfFileTypeChanged();` |  | Signals the OnTypeChange event handler when the value in FilterIndex is changed by the widgetset class instance.
`class function FindMaskInFilter();`
`class function ExtractAllFilterMasks();`
`published`
`property Title: TTranslateString;` |  | The Title or Caption displayed for the dialog.
`property DefaultExt: string; [rw]` |  | Contains the default extension for file names in the dialog.
`property FileName: string; [rw]` |  | Contains the UTF-8-encoded name for a file chosen using the dialog.
`property Filter: string; [rw]` |  | A string which contains available filename filters used to select files by their file extensions.
`property FilterIndex: Integer; [rw]` |  | This property sets which file filter is the default.
`property InitialDir: string; [rw]` |  | Contains the initial directory displayed when the dialog is opened.
`property OnHelpClicked: TNotifyEvent; [rw]` |  | Event handler signalled when the Help button is clicked.
`property OnTypeChange: TNotifyEvent; [rw]` |  | Event handler signalled when the selected file type or filter index is changed.
`end;`

## Inheritance

`TFileDialog` |  | TFileDialog allows selection of a file from the current directory.
`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

TFileDialog allows selection of a file from the current directory. This is also the base class for the Open and Save (As) dialogs.

## See also

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.