We don't display ads so we rely on your Bitcoin donations to 1KWEk9QaiJb2NwP5YFmR24LyUBa4JyuKqZ
Post date: Mar 15, 2010 9:17:02 PM
As with menus (menu items), an application can create an owner-drawn combo box to take responsibility for painting list items. An owner-drawn combo box can list/show information other than text strings - usually some graphical elements.
To create an owner-draw combo box, we set its Style property to csOwnerDrawFixed or csOwnerDrawVariable.
Having done this, Windows no longer draws the control. Instead it sends a WM_DRAWITEM message whenever a portion of the control needs to be repainted. The parent window (form) of an owner-drawn combo box (its owner) then fires the OnDrawItem event when a portion of the combo box needs to be painted.
To demonstrate owner-drawing with combo boxes create a combo box full of colors (two variations) and a combo with true-type fonts showing the actual image of the font.
Read more: http://delphi.about.com/od/vclusing/a/drawincombobox.htm
To read more about Owner Drawing in Delphi read: http://delphi.about.com/od/vclusing/a/owner_drawing.htm
Only Delphi source code is included in the archive.