...
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
begin
with ListBox1 do
begin
Columns:= 1;
Style:= lbOwnerDrawFixed;
for i:= 0 to 9 do
Items.Add('Item '+IntToStr(i));
Font.Size := 24; ItemHeight:= ImageList1.Height; end;
end;
procedure TForm1.ListBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
with TListBox(Control) do
begin
Canvas.FillRect(Rect);
ImageList1.Draw(Canvas, Rect.Left, Rect.Top, Index);
Canvas.TextOut(Rect.Left + ImageList1.Width + 10,
((Rect.Top+Rect.Bottom)div 2)-(Font.Size div 2), Items[Index]);
end;
end;
...