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

# TCustomFileListBox

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

Implements the base class for a file selection list box.

## Declaration

Source position: filectrl.pp line 45

`type TCustomFileListBox = class(TCustomListBox)`
`protected`
`procedure DoChangeFile; virtual;` |  | Performs actions needed when the selected file has changed in the control.
`procedure Loaded; override;` |  | Performs actions needed when the control has finished loading using the LCL component streaming mechanism
`function IndexOfFile();` |  | Gets the ordinal position for the specified file name in Items.
`procedure KeyUp(); override;` |  | Implements the handler for KeyUp events in the control.
`procedure SetItemIndex(); override;` |  | Sets the value for the ItemIndex property.
`public`
`constructor Create(); override;` |  | Constructor for the class instance.
`destructor Destroy; override;` |  | Destructor for the class instance.
`procedure Click; override;` |  | Performs actions needed when the mouse is clicked on the list box control.
`procedure UpdateFileList; virtual;` |  | Loads the list of files and/or directories for the list box control.
`property Drive: Char; [rw]` |  | The Drive on which the file is located (applies to Windows systems).
`property Directory: string; [rw]` |  | The Directory or Folder in which the file is located.
`property FileName: string; [rw]` |  | FileName - the name of the selected file.
`property FileType: TFileType; [rw]` |  | FileType - the type or attributes of the selected file.
`property Mask: string; [rws]` |  | Contains the mask for files selected for the control.
`property OnChange: TNotifyEvent; [rw]` |  | Event handler signalled when the selected file in the list box control is changed.
`property Sorted: Boolean;` |  | Indicates if values in Items are sort in ascending alphanumeric order.
`end;`

## Inheritance

`TCustomFileListBox` |  | Implements the base class for a file selection list box.
`TCustomListBox` |  | The base class for TListBox.
`TWinControl` |  | Implements a windowed control which can contain other child controls.
`TControl` |  | The base class for visible controls.
`TLCLComponent` |  | The base class for LCL components which have an associated widget.
`TComponent`
?
`TObject`

## Description

TCustomFileListBox is a TCustomListBox descendant which implements the base type for TFileListBox. TCustomFileListBox extends the ancestor with properties, methods, and events used to select a file or directory on the local file system in a list box control.

Use the Drive and Directory properties to specify the location on the local file system displayed in the list box. Please note that Drive is not used on UNIX-like file systems.

Use FileType to specify the files and/or directories which can be displayed in the control.

Use Mask to specify a file mask (with optional wildcards) used to select the files displayed in the control. Please note that wild cards may be implemented differently for some file systems. For example: '*' is the "all files" mask on UNIX-like file systems instead of "*.*".

Use the Sorted property to control the order of files and directories displayed in the control.

Use Items to access the file and/or directory names matching the FileType and Mask in the current Directory for the control. Directory names are enclosed in square brackets ([]).

Use FileName or ItemIndex to get or set the current selection in the control.

Assign an object procedure to the OnChange event handler to perform actions needed when a new item has been selected in the control.

Do not create instances of TCustomFileListBox. Use the TFileListBox descendant which sets the visibility of properties used in the class instance.

## See also

TFileListBox |  | Implements a file selection list box control.
TCustomListBox |  | The base class for TListBox.