Am 17.11.2022 um 00:03 schrieb Aruna Hewapathirane via lazarus:
Does anyone have any example code that populates a Listview component through code please?
procedure TForm1.FormCreate(Sender: TObject);
var
  item: TListItem;
  i: Integer;
begin
  for i := 0 to 9 do
  begin
    item := ListView1.Items.Add;
    item.Caption := 'Item ' + IntToStr(i);
    item.SubItems.Add('Subitem ' + IntToStr(i) + '/1');
    item.SubItems.Add('Subitem ' + IntToStr(i) + '/2');
    item.ImageIndex := i;
    item.SubItemImages[0] := i+1;
    item.SubItemImages[1] := i+2;
  end;
end;
--
_______________________________________________
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to