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

# SelectDirectory

A function that allows a user to select a directory.

## Declaration

Source position: dialogs.pp line 1017

`function SelectDirectory(`
`const Caption: string;`
`const InitialDirectory: string;`
`out Directory: string`
`):Boolean; function SelectDirectory(`
`const Caption: string;`
`const InitialDirectory: string;`
`out Directory: string;`
`ShowHidden: Boolean;`
`HelpCtx: LongInt = 0`
`):Boolean; function SelectDirectory(`
`out Directory: string;`
`Options: TSelectDirOpts;`
`HelpCtx: LongInt`
`):Boolean;`

## Arguments

`Caption` |  | A constant which sets the caption of the shown dialog.
`InitialDirectory` |  | The directory the dialog should start in.
`Directory` |  | A variable which on exit contains the selected directory.

## Function result

A boolean indicating if the user selected a directory and pressed OK.

## Arguments

`Caption` |  | A constant which sets the caption of the shown dialog.
`InitialDirectory` |  | The directory the dialog should start in.
`Directory` |  | A variable which on exit contains the selected directory.
`ShowHidden` |  | A boolean constant indicating whether hidden folders should be shown too.
`HelpCtx` |  | Help context for the dialog.

## Arguments

`Directory` |  | A variable which on exit contains the selected directory.
`Options` |  | Set of options enabled for the dialog.
`HelpCtx` |  | Help context for the dialog.

## Description

This function will show a dialog which allows the user to select the required directory when the directory structure is displayed as a tree.

Under Windows the caption from the resulting dialog cannot be set, but the label above the directory tree will have this value.

There are two version of this function, the second one having the ability to indicate whether hidden folders should be shown as well.