Mirror

How to make a TOpenDialog display folders only (Views: 100)


Problem/Question/Abstract:

Delphi has a TOpenDialog to choose files, but I need an open dialog to choose folders only.

Answer:

function DirectorySelect: string;
var
  dir_name: string;
  Options: TSelectDirOpts;
begin
  options := [];
  if SelectDirectory(dir_name, Options, 0) then
    Result := dir_name
  else
    Result := '';
end;

<< Back to main page