这个去看help吧,好像有现成例子,我就是看example学会的。

解决方案 »

  1.   

    第一个标题栏对应的是ListItem的Caption,其余是ListItem的SubItems。可以看Delphi的帮助(TCustomListView.Items)。
      

  2.   

    Var
    Item : TListItem;
    ...
    Item := TListItem.Add;
    Item.Caption := 'ABC';
    Item.SubItems.Add( '0' );
    Item.SubItems.Add( '1' );
    ...
      

  3.   

    listview1.Items.AddItem(Titemlist,index)
      

  4.   

    qs:='select * from T_content where crs_name like ''%'+trim(edit1.text)+'% order by classname';
        dm1.ADOQ1.SQL.Clear;
        dm1.ADOQ1.SQL.Add(qs);
        dm1.ADOQ1.Close;
        dm1.ADOQ1.Open;
        listview1.Items.Clear;
        for tmpint:=1 to dm1.ADOQ1.RecordCount do
        begin
          tmplistitem:=listview1.Items.Add;
          tmplistitem.Caption:=dm1.ADOQ1.FieldValues['crs_name'];
          tmplistitem.SubItems.Add(dm1.ADOQ1.FieldValues['classname']);
          tmplistitem.SubItems.Add(inttostr(round(dm1.ADOQ1.FieldValues['content_size']/1024)));
          tmplistitem.SubItems.Add(inttostr(dm1.ADOQ1.FieldValues['file_count']));
          tmplistitem.SubItems.Add(dm1.ADOQ1.FieldValues['savedir']);
          dm1.ADOQ1.Next;
        end;   
    看看这个例子,其中tmplistitem是   tmplistitem:TListItem;类型!