Вниз
Скачать: CL | DM;

Images в ComboBox   Найти похожие ветки 

 
Sergey2   (2008-05-16 11:00) [0]

Подскажите как в комобобоксе в выпадающем списке можно отобразить картинки ?


 
DVM ©   (2008-05-16 11:04) [1]

Style = csOwnerDrawFixed или csOwnerDrawVariable
+
OnDrawItem + возможно еще OnMeasureItem


 
Ega23 ©   (2008-05-16 11:07) [2]


procedure TCustomKdrDBLookupCombo.cbDrawItem(Control: TWinControl;
 Index: Integer; Rect: TRect; State: TOwnerDrawState);
var
 bmp : TBitmap;
 Offset : Integer;
begin
 with Canvas do
  begin
    FillRect(Rect);
    bmp := TLookupItem(Items.Objects[Index]).Bitmap;
    if bmp<>nil then
     begin
       BrushCopy(Bounds(Rect.Left + 2, Rect.Top, bmp.Width, bmp.Height),
                 bmp, Bounds(0, 0, bmp.Width, bmp.Height), bmp.TransparentColor);
       Offset := bmp.Width + 2;
     end
    else
      Offset := 2;
    TextOut(Rect.Left + Offset, Rect.Top, Items[Index]);  
  end; // width
end;


И всё это на OnDrawItem
Style := csOwnerDrawFixed;



Страницы: 1 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: -0.987 c
3-1199809422
Slimer
2008-01-08 19:23
2008.06.08
Zeos &amp; MySQL 4.1+


4-1190891664
apic
2007-09-27 15:14
2008.06.08
usb


2-1210838343
Вася
2008-05-15 11:59
2008.06.08
FireBird и Year()


15-1208979144
Loginov Dmitry
2008-04-23 23:32
2008.06.08
Многопоточность и Delphi


2-1210854797
pirks
2008-05-15 16:33
2008.06.08
xml форматированный текст




   Наверх