how to change color of a combobox?

Posted on 2007-08-06
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
    LVL 22

    Expert Comment

    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 :

    Also :WM_CTLCOLOR Processing for Combo Boxes of all Styles


    Author Comment

    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

    I will suggest you to skin your combobox, Refer folowing article with src :

    Skin the ComboBox in 3 simple function calls


    Author Comment

    thank you very much mahesh1402 ;-)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    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…
    Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
    The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
    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.

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    21 Experts available now in Live!

    Get 1:1 Help Now