请参考以下代码:
function rect2(left,top,width,heigth:integer):Trect;
begin
result:=rect(left,top,left+width,top+heigth);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
combobox1.DroppedDown := true
end;
procedure TForm1.ComboBox1DrawItem(Control: TWinControl; Index: Integer;
Rect: TRect; State: TOwnerDrawState);
var
bmp:Tbitmap;
MyRect, MyOther: TRect;
begin
MyRect:=Rect2(0,0+index*16,16,16);
myother:=rect2(0,0,16,16);
bmp:=Tbitmap.create;
combobox1.Canvas.Rectangle(rect);
ComboBox1.canvas.TextOut(rect.left+20,rect.Top,'dfdfd');
imagelist1.GetBitmap(index,bmp);
ComboBox1.Canvas.BrushCopy(MyRect, bmp, myother, clwhite);
bmp.Free;
end;