|
-
May 20th, 1999, 06:26 AM
#1
Changing background color of CComboBoxEx
..having a bit of a problem with this one..
-I've overridden the OnCtlColor method of CComboBoxEx, and changed the color of the background:
...
COLORREF ActiveBkColor =(COLORREF)0xdae4e9;
static CBrush ActiveBrush(ActiveBkColor);
HBRUSH Brush;
Brush = ActiveBrush;
pDC->SetBkColor(ActiveBkColor);
return Brush;
-Looks totally OK as long as I don't look at the popped-up list, where the background of the text (only) is still white!
-Where there is no TEXT, the background color is ok..
Does anybody have an idea as to what I can do?
Regards
/Torbjörn Josefsson
-
May 23rd, 1999, 04:06 PM
#2
Re: Changing background color of CComboBoxEx
From MSDN documentation on CWnd::OnCtlColor:
OnCtlColor will not be called for the list box of a drop-down combo box because the drop-down list box is actually a child of the combo box and not a child of the window. To change the color of the drop-down list box, create a CComboBox with an override of OnCtlColor that checks for CTLCOLOR_LISTBOX in the nCtlColor parameter. In this handler, the SetBkColor member function must be used to set the background color for the text.
-
September 14th, 2002, 10:08 AM
#3
It does not work for me. Does anybody have a solution?
-
December 13th, 2002, 06:13 AM
#4
Just before you set your Color in OnCtlColor, place the line:
pDC->SetBkMode(TRANSPARENT)
Hope this helps
Owen
-
September 9th, 2004, 09:03 AM
#5
Re: Changing background color of CComboBoxEx
Hi,
would u be so kind and post your complete entry in the OnCtlColor?
I´ve the same problem and wonder how it works.
THX!!!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|