V.3.1
ctlUniComboImageXP

Unicode Combo List-Box with optional images
>>Common properties

Some Properties/Methods:
AllowImages allows images to be displayed (use the OnOwnerDraw event and the ListTag/ListTagObject to save pictures if you want)
BeginUpdate / EndUpdate permits you to start a long-time update on the control (for example by adding 1000 elements) without sending out many and many events. So it is fast!
CloneFrom clones the list from another control
DropDown shows the dropdown list
DropDownWidth permits you to choose the size of the drop down list
HScroll permits you to assign an horizontal scroll bar to the dropdown list
IsDroppedDown is the list dropped down?
Sorted / Style available at runtime ;-)
Events:
AfterDropDown raised before closing the drop down list
BeforeDropDown raised before dropping down the list
ItemSelecting raised when selecting an item in the drop down list
MouseWheel raised when someone scrolls the mouse wheel
OnOwnerDrawn raised when an element needs to be drawn;
manage this event to set images to list items when needed.
The first pixel (0,0) of the image will be used as transparent color.
How to use the control:
Load items using the AddItem method; you can specify an additional Tag to each item (for example you can specify an item picture)
Then manage the OnOwnerDraw event and set images to items when needed.

Example:

On the Form_Load event:

With ctlUniComboImageXP1
       .AddItem "aaaa", , pic1.picture
       .AddItem "bbbbbb", , pic2.picture
       .AddItem "cccc"
End With


On the OnOwnerDraw event:

'If a tag has been specified
if (ctlUniComboImageXP1.ListTag(lItemIndex)<>"") Then
   Set oItemPic = ctlUniComboImageXP1.ListTagObject(lItemIndex)
End If
http://www.hexagora.com
Thu, 20 Oct 2011 07:20:48 UT
Copyright 2003-11 by Lorenzi Davide