将Combobox的Style属性设为csOwnerDrawFixed,假定Imagelist1中有几个图标
为Combobox加入字串
procedure TForm1.FormCreate(Sender: TObject);
var i: integer;
begin
for i:=0 to imagelist1.Count-1 do
Combobox1.Items.Add(inttostr(i));
end;
在OnItemDraw事件画图标及文本
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
begin
Combobox1.Canvas.FillRect(Rect);
imagelist1.Draw(Combobox1.Canvas,Rect.left,rect.top,index);
combobox1.canvas.TextOut(rect.Left+20,rect.top, inttostr(index));
end;