ListView读数据
数据从数据库读取。
如果某行的一个字段大于5ListView那行就平变红色。
如
while not ADOQuery1.eof then
begin
if ADOQuery.fieldByName('name').AsInteger>5 then
begin
listView变红色。
end;
end;
怎么实现呢?。
能有代码更好
数据从数据库读取。
如果某行的一个字段大于5ListView那行就平变红色。
如
while not ADOQuery1.eof then
begin
if ADOQuery.fieldByName('name').AsInteger>5 then
begin
listView变红色。
end;
end;
怎么实现呢?。
能有代码更好
比如说根据第一列来判断
procedure MainForm.listview1CustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
if (strtoint(Item.Caption) > 5) then
Sender.Canvas.Font.Color:=clRed;
else
Sender.Canvas.Font.Color:=clWindow;
end;