Solved

Is it possible to select multiple files in a FileListBox ?

Posted on 2011-03-24
3
543 Views
Last Modified: 2012-06-21
Is it possible to select multiple files in a FileListBox ? If so, how do I get a list of the selected files ?
0
Comment
Question by:ChLa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 24

Accepted Solution

by:
jimyX earned 125 total points
ID: 35207722
Set the property "MultiSelect" to True.
procedure TForm1.Button1Click(Sender: TObject);
var
  i:integer;
begin
  for i:= 0 to FileListBox1.Count-1 do
    if FileListBox1.Selected[i] then
      showmessage(FileListBox1.Items.Strings[i]);  // or do whatever you want
end;

Open in new window

0
 
LVL 32

Assisted Solution

by:Ephraim Wangoya
Ephraim Wangoya earned 125 total points
ID: 35207838
Have to set MultiSelect from the properties
Check the SelCount to see if multiple records are selected then loop thro the items checking the Selected[index] method


var
  I: Integer;
begin
  if FileListBox1.SelCount > 0 then
     for I := 0 to FileListBox1.Count-1 do
       if FileListBox1.Selected[I] then
          //your code
end;

Open in new window

0
 

Author Comment

by:ChLa
ID: 35208806







































That looks easy...Thank You








0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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