Hi
You can do it in the OnDrawItem event. Example of code:
Code:
procedure TForm1.AlertListDrawItem(Control: TWinControl; Index: Integer; Rect: TRect; State: TOwnerDrawState);
var
OldColor: TColor;
begin
with AlertList.Canvas do begin
OldColor := Font.Color;
case Index of
0: Font.Color := clGreen;
1: Font.Color := clRed
else Font.Color := clAqua;
end;
FillRect(Rect);
TextOut(Rect.Left, Rect.Top, AlertList.Items[Index]);
Font.Color := OldColor;
end;
end;
AlertList is the TsListBox here.