Вниз
Скачать: 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.015 c
15-1208856014
samalex
2008-04-22 13:20
2008.06.08
Установка символа разделения целой и дробной части числа


2-1210623772
rena
2008-05-13 00:22
2008.06.08
Расстановки ладей на шахматной доске


2-1210936640
hahol_64_rus
2008-05-16 15:17
2008.06.08
как возвести в степень


11-1190041757
Alexeis_
2007-09-17 19:09
2008.06.08
Более подробная информация о создании зеркал


15-1209127576
foo fighters
2008-04-25 16:46
2008.06.08
как с помощью командной строки узнать объем раздела?




   Наверх