You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Instead of using TOpenDialog, Delphi provides super simple function can select directory as following:

uses Vcl.FileCtrl;
.
.
.
var
  chosenDirectory : string;
begin
  // Ask the user to select a required directory, starting with C:
  if selectdirectory('Select a directory', 'C:\', chosenDirectory)
  then ShowMessage('Chosen directory = '+chosenDirectory)
  else ShowMessage('Directory selection aborted');
end;

Above is tested on Delphi 10.2

  • No labels