Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 563
  • Last Modified:

Is it possible to select multiple files in a FileListBox ?

Is it possible to select multiple files in a FileListBox ? If so, how do I get a list of the selected files ?
0
ChLa
Asked:
ChLa
2 Solutions
 
jimyXCommented:
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
 
Ephraim WangoyaCommented:
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
 
ChLaAuthor Commented:







































That looks easy...Thank You








0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now