TListItem* Item=ListView->Items->Add();Item->Caption="ddd";
.......

解决方案 »

  1.   

    1、用程序加:Listview1.Items.Add()
    2、在设计期间加:
    TListItem* Item=ListView->Items->Add();
    Item->Caption="ddd";
    .......
      

  2.   

    procedure TForm1.FormCreate(Sender: TObject);const
      Names: array[0..5, 0..1] of string = (
        ('Rubble', 'Barney'),
        ('Michael', 'Johnson'),
        ('Bunny', 'Bugs'),
        ('Silver', 'HiHo'),
        ('Simpson', 'Bart'),
        ('Squirrel', 'Rocky')
        );var
      I: Integer;
      NewColumn: TListColumn;
      ListItem: TListItem;
      ListView: TListView;
    begin
      ListView := TListView.Create(Self);
      with ListView do
      begin
        Parent := Self;
        Align := alClient;    ViewStyle := vsReport;    NewColumn := Columns.Add;
        NewColumn.Caption := 'Last';
        NewColumn := Columns.Add;
        NewColumn.Caption := 'First';    for I := Low(Names) to High(Names) do
        begin
          ListItem := Items.Add;
          ListItem.Caption := Names[I][0];
          ListItem.SubItems.Add(Names[I][1]);
        end;
      end;
    end;
      

  3.   

    var
    newitem:tlistitem;
    begin
      newitem:=listview1.items.add;
      newitem.caption:='sss';
      newitem.subitems.add('bbb');
      newitem.subitems.add('ccc');
    end;