CImageList in a CComboBox

I have a CImageList of colored boxes for a user to choose from (to designate which color they want to use for a certain action).

I want the CComboBox to display these colors when the list drops down.

How do I manage to paint those icons in each little slot of the combo box?

Thank you,



Color: | o | <- that's a combo box
       | o |
       | o |

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


I.e. here is the color picker combo box:
You can find more from: site.

It's simplier than using image list to showing colors.
You should use the MFC extended combo box control - CComboBoxEx.  It was written specifically to tackle your problem - i.e. images displayed in combo boxes

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
SuperMarioAuthor Commented:
Can you post some code to use a CImageList array element in a CComboBoxEx?

It's very simple really. Much the same as using images in list and tree controls.

See the article...

Visual C++ Programmer's Guide\Adding User Interface Features\Details\Control Topics\Using CComboBoxEx

I'd only cut and paste the code from there if I was to provide an example for you.
SuperMarioAuthor Commented:
Perfect. Thanks!

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.