?
Solved

TOpenDialog and MultiSelect

Posted on 2002-03-23
4
Medium Priority
?
1,259 Views
Last Modified: 2012-05-04
I can get a TOpenDialog to select a directory but I cann ot get it to multiselect several directories.
(I have ofAllowMultiSelect = true.)
What else do I need to do?


0
Comment
Question by:frog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 7

Expert Comment

by:Motaz
ID: 6891858
You cann't select directory by TOpenDialog, if you mean multiple files, then you are right only turn ofAllowMultiSelect to True, then you can select many files:

  if OpenDialog1.Execute then
    ShowMessage(OpenDialog1.Files.Text);

Motaz
0
 
LVL 1

Accepted Solution

by:
rfedyk earned 200 total points
ID: 6892074
Hi frog,

Try combining a TDirectoryOutline with a TListBox. In the TDirectoryOutline.OnChange event add the next directory name to the TListBox.Items.

Use a button to terminate the directory selection and start directory processing. If you create a TFileListBox you can set its Directory property to each name in the ListBox, in turn, and then access the files that you need from the TFileListBox.Items.

Roger

0
 

Author Comment

by:frog
ID: 6893406
Thanks Motaz and Roger for your comments.

I don't want to access any files, I just want to multiselect several directories and have them listed in the TStrings like multiselected files do.
By setting OpenDialog.Filename to any string, say 'dir', before the .execute the OpenDialog will select a single directory and return its path. But it will not multiselect directories. I was hoping for a patch that would enable multiselect for directories.
I would like to use TOpenDialog for consistencey with other file and directory selection tasks.
This particular task is 'Select the directories you want to search'  then the user multiselects several directories, then the application searches the selected directories, etc.

0
 

Expert Comment

by:CleanupPing
ID: 9343229
frog:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question