Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2008.06.08;
Скачать: 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 вся ветка

Текущий архив: 2008.06.08;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.015 c
11-1190041757
Alexeis_
2007-09-17 19:09
2008.06.08
Более подробная информация о создании зеркал


15-1209047607
Slider007
2008-04-24 18:33
2008.06.08
С днем рождения ! 24 апреля 2007 четверг


15-1208931582
ILR
2008-04-23 10:19
2008.06.08
Помогите с задачей


2-1210956768
Res
2008-05-16 20:52
2008.06.08
ExtractRes


2-1208938664
Arinyshka
2008-04-23 12:17
2008.06.08
Освобождение ресурса в finally