var listitem:Tlistitem; begin listitem:=listview1.items.add; listitem.Caption := '12345'; listitem.SubItems.Add('23456'); end;
re (3、如何得到当前选中行?)procedure TForm1.ListView1SelectItem(Sender: TObject; Item: TListItem; Selected: Boolean); begin if Selected then Caption := Item.SubItems[Item.SubItems.count-1]; end;
listitem:Tlistitem;
begin
listitem:=listview1.items.add;
listitem.Caption := '12345';
listitem.SubItems.Add('23456');
end;
Selected: Boolean);
begin
if Selected then Caption := Item.SubItems[Item.SubItems.count-1];
end;
我想让一个column的width等于listview的宽度的一半,
但listview1.columns[0].width返回Twidth型
而listview1.width返回整形,如何让他们一致?