Link to home
Start Free TrialLog in
Avatar of ChrisBerry
ChrisBerryFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Open Direcctory Dialog - Does one exist?

I cannot believe this does not exist in the current set of components, Delphi 7, as it must be something loads of apps require.

The win 3.1 pallete has a component to open a directory but unfortunately it cannot handle networks unless the drive is mapped.

Can I use the OpenDialog to open directories, I do not wish to select a file then extract the path. If so how do I go about this, if not how do I go about this?

Cheers

Chris
Avatar of ceoworks
ceoworks

Hi Chris,

It should be exist in Dialogs tab. If it's not, take a look at the Component -> Configure Palette menu and select "All" from the left side and sort the components by their name. With this way, you can find where is TOpenDialog component is..  If you can't find it from there, install the dclstd70 package.

Cheers,

Oktay Sancak
use SelectDirectory function from FileCtrl unit.
Avatar of ChrisBerry

ASKER

Hi

Thanks for the replies.

First. I have already tried the SelectDirectory function but this gives a dialog that again uses mapped directories, I want to have access to NetworkNeighborhood.

Second. TOpenDialog I have but this always requires me to select a file, I just want to select a directory. A TOpenDialog that would allow me to select a directory is just what I want. Am I missing something, as I cannot find this option in TOpenDialog?

Cheers

Chris
you can use SelectDirectory function:

uses FileCtrl;

var
  Dir: string;
begin
  if SelectDirectory(Choose the Source Dir! ', '\\frapsnt69\Backup', Dir) then
  begin
    Edit_Source.Text := Dir;
  end;
end;
ASKER CERTIFIED SOLUTION
Avatar of bpana
bpana

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great, got it!

I tried the wrong overload before.

Thanks

Chris