Click here to Skip to main content
15,887,405 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,
I want create a combobox having an icon and a description in the same row. The icon is not in the resource (it must be a rectangle filled by a logical color), so I must create my CImageList run-time (DrawIndirect()?).
I've already read all msdn documentation (http://msdn.microsoft.com/en-us/library/52hkw8ts(VS.80).aspx), but I can't fill my CComboBoxEx (even without icons), while I can fill a CComboBox (using AddString() method).
Could someone explain me how can I create a combobox with images?
Thanks a lot


...

nobody?
Posted
Updated 13-Sep-10 3:27am
v3

i see such an answer. is it what you looking for?

A combobox can use any object, including images.
http://msdn2.microsoft.com/en-us/library/system.windows.forms.combobox.objectcollection.aspx[^]
You can use the Items.Add method to display an image, something like this:
Dim img As New Image()
Dim bimg As New BitmapImage(New Uri("image.jpg", UriKind.Relative) )
img.Source = bimg
Dim item As New ListBoxItem()
item.Content = img
combo.Items.Add(item)
 
Share this answer
 
............... :sigh: ............
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900