kolor

0

Jak zmieniać kolor czcionki wybranej pozycji w listboxie?

0

Obsluz OnDrawItem ListBoxu:

procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
with ListBox1.Canvas do
begin
if odSelected in State then
begin
Font.Color:=clRed;

   end
else
   Font.Color:=clGreen;

Brush.Color:=clWhite;
Pen.Color:=clWhite;
Rectangle(Rect);
TextOut(Rect.Left,Rect.Top,ListBox1.Items[Index]);

end;

end;
--Pawel

Delphi6

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