Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to add icons to VBA comboboxes?

Status
Not open for further replies.

EdmCath

Technical User
Jun 22, 2004
34
CA
I want to add some graphics to my comboboxes so I would have a description and then a symbol after it. AutoCAD uses it in its layer and colour combos and I would like to mimic that same behaviour.

Any advice would be great

Thanks

Murray Johnson
 
Can't be done in pure vba/msforms. You can use either API to enhance combobox or, if you have it licensed (and so end user), ImageCombo with ImageList components from Common Controls library (MSComctlLib).
After adding images to the ImageList, the initialisation code could be:
Code:
ImageCombo1.ImageList = ImageList1
With ImageCombo1.ComboItems
    .Add Text:="Text 1", Image:=1, SelImage:=2
    .Add Text:="Text 2", Image:=2, SelImage:=1
End With
The display order is graphic and text.

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top