unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    ListBox1: TListBox;
    procedure ListBox1DrawItem(Control: TWinControl; Index: Integer;
      Rect: TRect; State: TOwnerDrawState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
  begin
  with ListBox1.Canvas do  //rysowanie na liœcie
  if Index mod 2=0 then  //czy indeks parzysty
  begin
     ListBox1.Canvas.Font.Color:=clgreen;
     TextOut(Rect.Left, Rect.Top, ListBox1.Items[index]);
  end
  else
  begin
     ListBox1.Canvas.Font.Color:=clRed;
     TextOut(Rect.Left, Rect.Top, ListBox1.Items[Index]);
  end;

end;

end.
