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

# SelectDirectory

A function that allows to user to select a directory.

## Declaration

Source position: line 0

`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.

## Function result

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

## Arguments

`Directory` |  | A variable which on exit contains the selected directory.

## Function result

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

## 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.

The latest version of this document can be found at lazarus-ccr.sourceforge.net .