• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3809
  • Last Modified:

how to change color of a combobox?

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.
thanks.
0
batang_igat
Asked:
batang_igat
  • 2
  • 2
1 Solution
 
mahesh1402Commented:
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
http://support.microsoft.com/kb/q81707/

-MAHESH
0
 
batang_igatAuthor Commented:
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
0
 
mahesh1402Commented:
I will suggest you to skin your combobox, Refer folowing article with src :

Skin the ComboBox in 3 simple function calls
http://www.codeproject.com/combobox/Skin_Combo_Box.asp

-MAHESH
0
 
batang_igatAuthor Commented:
thank you very much mahesh1402 ;-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now