Recent

Author Topic: OpenPictureDialog - Allow multiple selection and access to variables.  (Read 8830 times)

seba22

  • Full Member
  • ***
  • Posts: 136
Welcome,

How can i acces to multiple selected files using OpenPictureDialog ?

If i have only one file it's simple:
picture:=OpenPictureDialog1.FileName;     

But when i wan't access few files ?

Please attach example what print all selected files.

Code: [Select]
showmessage('file1');
showmessage('file2');
showmessage('file3');
showmessage('file4');


Regards

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: OpenPictureDialog - Allow multiple selection and access to variables.
« Reply #1 on: September 13, 2010, 11:37:21 pm »
How can i acces to multiple selected files using OpenPictureDialog ?

OpenPictureDialog has a Files property which is of type TStrings.

seba22

  • Full Member
  • ***
  • Posts: 136
Re: OpenPictureDialog - Allow multiple selection and access to variables.
« Reply #2 on: September 14, 2010, 06:26:34 am »
Thank You.

If someone looking for answer, here is solution.


Code: [Select]
var counter:integer;
begin
 if OpenPictureDialog1.Execute then
 begin
    for counter:=0 to OpenPictureDialog1.Files.Count-1 do
       begin
          showmessage(OpenPictureDialog1.Files.Strings[counter:integer]);
          end;
 end ;
end;

But you have to remember click "allow multiple selection" at object inspector.


Regards

 

TinyPortal © 2005-2018