I am using TTNTListView in Delphi 7. It is installed on vsReport. On the OnCustomDrawSubItem event, I use this code:
procedure TForm.ListViewCustomDrawSubItem(Sender: TCustomListView; Item: TListItem; SubItem: Integer; State: TCustomDrawState; var DefaultDraw: Boolean); begin if SubItem = 2 then if (Item.SubItems.Strings[1] = Text1) or (Item.SubItems.Strings[1] = Text2) then Sender.Canvas.Font.Color := clGreen else Sender.Canvas.Font.Color := clRed; end;
The problem is that all subelements> = 3 are drawn with the same color as subelement 2. I checked for SubItem> = 3 Sender.Canvas.Font.Color - clBlack, but they are drawn using clRed and clGreen. If this is a problem in my code, please show me how to fix it. If this is a mistake, maybe someone knows a workaround. Thanks.
source share