Solved

TOpenDialog and MultiSelect

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

679 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