Solved

TOpenDialog and MultiSelect

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

929 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

11 Experts available now in Live!

Get 1:1 Help Now