Solved

TOpenDialog and MultiSelect

Posted on 2002-03-23
4
1,218 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
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 50 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now