L lpzst002 Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-26 #1 我的listview的viewstyle是vsreport的,现在是如何才能语句动态添加listview里面的 item和subitem让他们的数据在同一行[][!]
N navy Unregistered / Unconfirmed GUEST, unregistred user! 2002-08-26 #2 var NewColumn: TListColumn; ListItem: TListItem; begin with ListView do begin ViewStyle := vsReport; //!!! NewColumn := Columns.Add; NewColumn.Caption := 'Last'; NewColumn := Columns.Add; NewColumn.Caption := 'First'; for I :=1 to 10 do begin ListItem := Items.Add; ListItem.Caption := inttostr(i); ListItem.SubItems.Add(inttostr(i*i)); end; end; end;
var NewColumn: TListColumn; ListItem: TListItem; begin with ListView do begin ViewStyle := vsReport; //!!! NewColumn := Columns.Add; NewColumn.Caption := 'Last'; NewColumn := Columns.Add; NewColumn.Caption := 'First'; for I :=1 to 10 do begin ListItem := Items.Add; ListItem.Caption := inttostr(i); ListItem.SubItems.Add(inttostr(i*i)); end; end; end;