Board index » delphi » Multiple selection in fileopendialog

Multiple selection in fileopendialog

Hi all,

I need to select multiple files in my application with the
fileopendialog in order to put these files together into one. I found
out that I can store Data of the selected filenames in the "FileHistory"
of the TOpenDialog but it has its limits. It seems to "forget" all
selected filenames if their lengths together are  longer than a certain
length (probably 256 characters).
Is there an elegant possibility to provide - so to say - unlimited file
selection?

Thanks in advance!

 

Re:Multiple selection in fileopendialog


Quote
> Is there an elegant possibility to provide - so to say - unlimited file
> selection?

Add to a MyOpenDlg-Form DriveComboBox, DirList, FileList on one side
and a Memo or something like this on the other side. In OnClick of a
Button copy the selected Files to the Memo.
I dont know if this is elegant, but it works ;)
Jens

Re:Multiple selection in fileopendialog


Thank you for your answer. I now have found out that with OpenDialogs there
is a property called "files" where all the selected filenames are stored.
I didn't want to use the DirList and FileList because they are actually
Win3.1 components. For instance there is no possibility to have a horizontal
scrollbar in the DirList and it costs further efforts to get 3D-folders like
those now usual in Win95/98...

Peter

Jens Fischer schrieb:

Quote
> > Is there an elegant possibility to provide - so to say - unlimited file
> > selection?
> Add to a MyOpenDlg-Form DriveComboBox, DirList, FileList on one side
> and a Memo or something like this on the other side. In OnClick of a
> Button copy the selected Files to the Memo.
> I dont know if this is elegant, but it works ;)
> Jens

Re:Multiple selection in fileopendialog


In article <38EA510A.A4D28...@t-online.de>, Peter Wagner

Quote
<OvidiusN...@t-online.de> writes:
>I need to select multiple files in my application with the
>fileopendialog in order to put these files together into one.

FileHistory is contra-indicated. Set ofAllowMultiSelect in Options and extract
the multiple files selected from the Files property of the TOpenDialog. This is
a TStrings containing the filepathname of all those selected.

  MyStringList.Assign(OpenDialog1.Files);

Look up the Files property for TOpenDialog in OLH.

Alan Lloyd
alangll...@aol.com

Other Threads