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,

-Dan

=====

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

etc
LVL 3
SuperMarioAsked:
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.

cyberfrankCommented:
Hi!

I.e. here is the color picker combo box:
http://www.codeguru.com/combobox/combo_color_picker.shtml
You can find more from:
http://www.codeguru.com/combobox/index.shtml site.

It's simplier than using image list to showing colors.
CF
0
carldeanCommented:
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
0

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?

Thanks,
Dan
0
carldeanCommented:
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.
0
SuperMarioAuthor Commented:
Perfect. Thanks!

0
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.