geht nicht!!! hier nochma ein code :
Delphi-Quellcode:
implementation
{$R *.DFM}
procedure ZeileFaerben(Zeile:integer;Farbe:integer;Listbox1:TListbox;
Index:Integer;Rect:TRect);
begin
if Index<>Zeile then
Farbe:=clBlack;
Listbox1.Canvas.Brush.Color:=clWhite;
Listbox1.Canvas.Pen.Color:=Farbe;
Listbox1.Canvas.FillRect(Rect);
Listbox1.Canvas.Font.Color:=Farbe;
Listbox1.Canvas.TextOut(Rect.Left,Rect.Top,Listbox1.Items[Index]);
end;
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
if Control is TListbox then
begin
TListbox(Control).Canvas.FillRect(Rect);
if TListbox(Control).Items.Strings[Index] = 'verliehen' then
TListbox(Control).Canvas.Font.Color := clRed
else
if odSelected in State then
TListbox(Control).Canvas.Font.Color := graphics.clHighlightText
else
TListbox(Control).Canvas.Font.Color := graphics.clBtnText;
TListbox(Control).Canvas.TextOut(Rect.Left, Rect.Top, TListbox(Control).Items[Index]);
end;
end;
end.