[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


how to change color of a combobox?

Posted on 2007-08-06
Medium Priority
Last Modified: 2013-12-14
I would like to know if I can change the image or color of a combobox in C++ MFC?
the normal color would be a gray button with a white colored dropdown for the items.
i would like to change the combobox button (for example green) to match with the background that i have for my application.

if this is possible, please let me know.
you can also give me some keywords to search on to lead me to the right search path.
i have tried searching for hours but to no avail.

please help.
Question by:batang_igat
  • 2
  • 2
LVL 22

Expert Comment

ID: 19636990
Subclass edit control portion of the combobox and then use OnCtlColor() to change color.

To subclass, take a look at following:

HOWTO: Subclass CListBox and CEdit Inside of CComboBox
ID: Q174667 :http://support.microsoft.com/kb/174667

Also :WM_CTLCOLOR Processing for Combo Boxes of all Styles


Author Comment

ID: 19642642
thanks mahesh.

can i possibly load a picture / image to change the button design instead of changing just the color?

i would just like to know if it is possible... :-D
LVL 22

Accepted Solution

mahesh1402 earned 375 total points
ID: 19643396
I will suggest you to skin your combobox, Refer folowing article with src :

Skin the ComboBox in 3 simple function calls


Author Comment

ID: 19650580
thank you very much mahesh1402 ;-)

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question