MSVC++ ComboBox Color
Anyone know how to change the background color in a ComboBox? I'm doing MFC programming using MSVC++ 6.0. From what I can see SetColor and BackgroundColor are not available. I would like to do this without redrawing the box if at all possible.
I seen code for this and it wasnt pretty. The way i viewed it you have to draw it your self. Unlike VB, where you can just change the number to what ever color you want. There is another way I think, but you might have to do some research on it.
Using the standard win API you can trap the WM_CTLCOLOREDIT message for the editable part of the combo box and the WM_CTLCOLORLISTBOX message for the drop down box.
For both of these messages the LPARAM is a handle to the control, from which you can obtain a DC and insert a new brush and background colour.
I'm not entirely sure how you'd do this with MFC, but there may be a simpler method here.
Thanks for the help... I went ahead and redrew the box. I was a pain and wasn't pretty, but it worked....