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

# TCustomFileListBox.Directory

The Directory or Folder in which the file is located.

## Declaration

Source position: filectrl.pp line 74

`public property TCustomFileListBox.Directory : string read FDirectory write SetDirectory;`

## Description

Directory is a String property which contains the path on the local file system to the files or and/or directories displayed in the list box control. The initial value for Directory is assigned in the constructor and defaults to the current directory for the application.

The value in Directory is prepended to the value in Filename when the UpdateSelectedFileName method is called from methods like: Click, KeyUp, SetItemIndex, SetFileName.

Changing the value in Directory causes the UpdateFileList method to be called to reload the file and or directory names stored in the Items property.

Remark: | Changing the value in Directory does not automatically update the value in Drive. If Directory includes a drive designator like 'D:\config\', the drive portion is not applied to the Drive property. In addition, setting a value in Drive does not update the value in Directory. The only time Drive and Directory are automatically sync'd is in the Create constructor.

## See also

TCustomFileListBox.FileName |  | FileName - the name of the selected file.
TCustomFileListBox.Drive |  | The Drive on which the file is located (applies to Windows systems).
TCustomFileListBox.UpdateFileList |  | Loads the list of files and/or directories for the list box control.
TCustomFileListBox.Click |  | Performs actions needed when the mouse is clicked on the list box control.
TCustomFileListBox.KeyUp |  | Implements the handler for KeyUp events in the control.
TCustomFileListBox.SetItemIndex |  | Sets the value for the ItemIndex property.
TCustomListBox.ItemIndex |  | Ordinal position for the currently selected item, -1 if none.