Link to home
Start Free TrialLog in
Avatar of jackjoker
jackjoker

asked on

ImageList

Is there a way to add all the images in the ImageList to a ListView as an Item?
Avatar of simonet
simonet
Flag of Brazil image

All the images as an item? What do you mean?

Alex
Avatar of jackjoker
jackjoker

ASKER

Let's say the ImageList as 5 images.
I want to add 5 items to the ListView, with the five images front the ImageList respectively.
ASKER CERTIFIED SOLUTION
Avatar of rwilson032697
rwilson032697

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hi jackjoker,

more specified

procedure TForm1.Button1Click(Sender: TObject);
var
  Item : TListItem;
  I : Integer;
begin
  ListView1.LargeImages := ImageList1;
  ListView1.ViewStyle := vsIcon;
  for i := 0 to Imagelist1.Count - 1 do
  begin
    Item := ListView1.Items.Add;
    Item.ImageIndex := I;
    Item.Caption := 'Image '+IntToStr(I);
  end;
end;

meikl