K ks_reny Unregistered / Unconfirmed GUEST, unregistred user! 2008-04-08 #1 各位兄弟们,我现在要实现一个listbox中根据item的值来显示不同的颜色.根据item的值来判断颜色.请高手们指点一下.
C Corn3 Unregistered / Unconfirmed GUEST, unregistred user! 2008-04-08 #2 procedure TForm1.lvListCustomDrawItem(Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); begin if Item.SubItems[5]='退款' then Sender.Canvas.Font.Color:=clRed else Sender.Canvas.Font.Color:=clBlack; end;
procedure TForm1.lvListCustomDrawItem(Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean); begin if Item.SubItems[5]='退款' then Sender.Canvas.Font.Color:=clRed else Sender.Canvas.Font.Color:=clBlack; end;