T:=0;
with listview1 do
for i:= 0 to items.count-1 do
begin
  T:=T+Strttfloat(items[i].subitems[3]);
end;T是第3例的合计

解决方案 »

  1.   

    T:=0;
    with listview1 do
    begin
      for i:= 0 to Items.count-1 do
      begin
        T:=T+StrtoFloat(Items[i].SubItems.Strings[3]);
      end;
    end;
      

  2.   

    procedure TForm1.Button1Click(Sender: TObject);
    var i:integer;
        ts:TListItem;
        total:integer;
    begin
      total:=0;
      for i:=0 to mylv1.Items.Count-1 do
        begin
          ts:=mylv1.Items[i];
          total:=total+strtoint(ts.SubItems[num]);
    //num为需统计的列
        end;
    showmessage(inttostr(total));
    end;