我使用listview控件静态设置三列.
然后我在程序中动态为三列都赋值,不知道用什么方法.
如additem方法只能对每行的第一列赋值,而第二、三列却不能赋值。

解决方案 »

  1.   

    var
     ListItem: TListItem;begin
    ListView1.ViewStyle := vsReport;
    ListItem:=ListView1.Items.Add ;
    listitem.Caption := '0';
    listitem.SubItems.Add ('1');
    listitem.SubItems.Add ('2');end;
      

  2.   

    ListItem: TListItem;我不明白为什么要设置这样的变量.请指教.
      

  3.   

    TListItem is an individual item of a TListView control. 
    Use TListItem to specify the appearance and data associations of an item in a list view. All the list items of the list view are collected by a TListItems object to make up the Items property of the TListView control.