Versuch es mal so:
Delphi-Quellcode:
procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
if (SubItem = 1) AND (Item.Index = 1) then
Sender.Canvas.Brush.Color := clGreen;
Sender.Canvas.Brush.Color:= Sender.Canvas.Brush.Color + 1;
Sender.Canvas.Brush.Color:= Sender.Canvas.Brush.Color - 1;
end;
oder so
Delphi-Quellcode:
procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
if (SubItem = 1) AND (Item.Index = 1) then
Sender.Canvas.Brush.Color := clGreen
else
Sender.Canvas.Brush.Color:= Sender.Canvas.Brush.Color + 1;
Sender.Canvas.Brush.Color:= Sender.Canvas.Brush.Color - 1;
end;
end;
oder so
Delphi-Quellcode:
procedure TForm1.ListView1CustomDrawSubItem(Sender: TCustomListView;
Item: TListItem; SubItem: Integer; State: TCustomDrawState;
var DefaultDraw: Boolean);
begin
if Item.Index = 1 then
case SubItem of
1: Sender.Canvas.Brush.Color := clGreen;
else
Sender.Canvas.Brush.Color:= Sender.Canvas.Brush.Color + 1;
Sender.Canvas.Brush.Color:= Sender.Canvas.Brush.Color - 1;
end;
end;
Ich hab mich mit den Zeilen
Delphi-Quellcode:
Sender.Canvas.Brush.Color:= Sender.Canvas.Brush.Color + 1;
Sender.Canvas.Brush.Color:= Sender.Canvas.Brush.Color - 1;
kurz ausweinender gesetzt, aber nicht wirklich rausgefunden was sie bewirken. Auf jeden Fall korrigieren sie wieder die Brush Farbe.