[Delphi] ListView !

0

Witam !

Czy wie ktos moze jak zrobic cos takiego ?

If a>10 then
wiersze z ListViewa maja tlo czerwone
else
wiersze z ListViewa maja tlo normalne (biale)

Mam nadzieje ze zrozumiecie o co mi chodzi ! ;-)

Pozdrawiam !

0

procedure TForm1.ListCustomDrawItem(Sender: TCustomListView;
Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);

begin
if A > 10 then
Sender.Canvas.Brush.Color:= clWhite
else
Sender.Canvas.Brush.Color:= clRed;
end;

//to chyba tak było

0

Ale nie wie ktos moze jak zrobic aby np. tylko 2 wiersz w Listview mial tlo czerwone ??? [???]

0

w OnCustomDrawItem

if Item.Index=1 then
ListView1.Canvas.Brush.Color:= clRed;

1 użytkowników online, w tym zalogowanych: 0, gości: 1