Home > database >  Adding 2 Memo lines into ListView Items
Adding 2 Memo lines into ListView Items

Time:09-27

I need to add Listview items from 2 Memos. I am using Delphi 10.2 Tokyo

Memo1 lines are as

line1
line2
line3
line4
line5

Memo2 lines are as

something1
something2
something3
something4
something5

Need to add these 2 Memo lines into Listview

Listview Caption = Memo1 lines

Listview SubItem = Memo2 lines

Need help

CodePudding user response:

for var i := 0 to Memo1.Lines.Count - 1 do
begin
  var item := ListView.Items.Add;
  item.Caption := Memo1.Lines[i];
  item.SubItems.Add(Memo2.Lines[i];
end;

CodePudding user response:

for var i := 0 to Memo1.Lines.Count - 1 do
begin
  var Item := ListView.Items.Add;
  Item.Caption := Memo1.Lines[i];
  Item.SubItems.Add (Memo2.Lines[i]);
end;
 
  • Related