Вниз
Скачать: 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.012 c
2-1210834088
big
2008-05-15 10:48
2008.06.08
Как в StringGrid e удалить выделенную строку?


2-1211094428
Квэнди
2008-05-18 11:07
2008.06.08
Замена собственного исполняемого файла


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


15-1209015532
oxffff
2008-04-24 09:38
2008.06.08
УРА!!!!!!!!!!!!!!!!!!! Delphi RoadMap


15-1209317345
No_Dead
2008-04-27 21:29
2008.06.08
Что пишут в логах?




   Наверх