...in einer TListView farbige Zeilen erstellen?

Autor: Simon Grossenbacher
Homepage: http://www.swissdelphicenter.ch

Kategorie: VCL

procedure TForm1.ListView1CustomDrawItem(Sender: TCustomListView;
  Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
begin
  with ListView1.Canvas.Brush do
  begin
    case Item.Index of
      0: Color := clYellow;
      1: Color := clGreen;
      2: Color := clRed;
    end;
  end;
end;

 

printed from
www.swissdelphicenter.ch
developers knowledge base