Вниз
Скачать: 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.013 c
2-1210854738
Tommy
2008-05-15 16:32
2008.06.08
MySQL и Delphi


15-1208948348
Maks0
2008-04-23 14:59
2008.06.08
Стойкость пароля в битах


15-1209048184
i
2008-04-24 18:43
2008.06.08
проблемы с win2003 r2..


2-1211107765
Alexei
2008-05-18 14:49
2008.06.08
Как узнать версию файла?


15-1208894835
Jolik
2008-04-23 00:07
2008.06.08
Подскажите профайлер для Delphi 2007 for Win32




   Наверх