Author: Jonas Bilinkevicius How to highlight alternate rows in a TListView Answer: The following will draw all alternate lines with yellow text on blue background. It uses the OnAdvancedCustomDraw events of the listview. As a bonus you get full highlighting of selected lines. 1 2 procedure CheckPaintstage(Stage: TCustomDrawStage; itemIndex: Integer; canvas: 3 TCanvas); 4 begin 5 if Stage in [cdPrePaint, cdPreErase] then 6 begin 7 if Odd(itemIndex) then 8 begin 9 Canvas.Brush.Color := clBlue; 10 if Stage = cdPrepaint then 11 Canvas.Font.color := clYellow; 12 end 13 end; 14 end; 15 16 procedure TForm1.ListView1AdvancedCustomDrawItem(Sender: TCustomListView; 17 Item: TListItem; State: TCustomDrawState; Stage: TCustomDrawStage; 18 var DefaultDraw: Boolean); 19 begin 20 if not (cdsSelected in State) then 21 CheckPaintstage(Stage, item.Index, sender.canvas) 22 else 23 Sender.Canvas.Brush.Color := clHighlight; 24 end; 25 26 procedure TForm1.ListView1AdvancedCustomDrawSubItem(Sender: TCustomListView; 27 Item: TListItem; SubItem: Integer; State: TCustomDrawState; Stage: 28 TCustomDrawStage; 29 var DefaultDraw: Boolean); 30 begin 31 if not (cdsSelected in State) then 32 CheckPaintstage(Stage, item.Index, sender.canvas) 33 else 34 begin 35 Sender.Canvas.Font.Color := clHighlightText; 36 Sender.Canvas.Brush.Color := clHighlight; 37 end; 38 end;