ChrisBerry
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
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
use SelectDirectory function from FileCtrl unit.
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
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
heres's an example:
http://delphi.about.com/library/weekly/aa070400a.htm
http://delphi.about.com/library/weekly/aa070400a.htm
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;
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great, got it!
I tried the wrong overload before.
Thanks
Chris
I tried the wrong overload before.
Thanks
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