是不是这样
procedure Tfm_PlayAudio.ListBox1DrawItem(Control: TWinControl;
Index: Integer;
Rect: TRect;
State: TOwnerDrawState);
begin
//
with (Control as TListBox).Canvasdo
begin
FillRect(Rect);
if odSelected in State then
begin
Font.Color := clMaroon;
// Font.Style := Font.Style + [fsBold];
end
else
Font.Color := clblue;
if Index mod 2 = 0 then
Font.Color := clLime
else
Font.color := clRed;
//display the text
TextOut(Rect.Left, Rect.Top, ListBox1.Items[Index]) ;
end;
end;