Código
Rect: TRect; State: TOwnerDrawState);
begin
if odSelected in State then
begin
ListBox1.Canvas.Brush.Color := clHighlight;
ListBox1.Canvas.Font.Color := clHighlightText;
end else
begin
ListBox1.Canvas.Font.Color := clBlack;
if Odd(Index) then
ListBox1.Canvas.Brush.Color := clMoneyGreen
else
ListBox1.Canvas.Brush.Color := clWindow;
end;
ListBox1.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2,
ListBox1.Items[Index]);
end;
//Mude a propriedade Style para lbOwnerDrawFixed
Planeta Delphi - www.planetadelphi.com.br - Todos os direitos reservados | Copyright 2001-2009