Topic: How to select a folder?

I am trying to use the TSelectDirectoryDialog to select a folder.  I know I can use the TOpenDialog but it requires selecting a filename from which I can extract the path.  I would prefer the user to select the destination folder instead.

Thank you,
  Robb

Re: How to select a folder?

Example:

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    sDirectory: string;
begin
    if SelectDirectory('Caption','c:\', sDirectory) then
    begin
        ShowMessage('Selected: ' + sDirectory);
    end;
end;
Dmitry.

Re: How to select a folder?

Perfect. Thank you.

Re: How to select a folder?

Dimitry,
Is there an option in SelectDirectory that will allow the end user to create a directory within the same dialog box as the SelectDirectory, if the directory is not present? I have seen this in other Windows applications. Just wondering if you can do it here.

Re: How to select a folder?

ehwagner wrote:

Dimitry,
Is there an option in SelectDirectory that will allow the end user to create a directory within the same dialog box as the SelectDirectory, if the directory is not present? I have seen this in other Windows applications. Just wondering if you can do it here.

Hello,


I added this options in the latest beta version, please download
https://www.dropbox.com/s/kfh2q7h8l73lx … a.zip?dl=0


example:

    SelectDirectory('Caption', 'c:\', s); // default dialog
    SelectDirectory('Caption', 'c:\', s, True); // with button create a directory
    SelectDirectory('Caption', 'c:\', s, True, True); // with button create a directory and shows files
Dmitry.

Re: How to select a folder?

Awesome! Thanks Dimitry.