EDN Admin
Well-known member
Hi,
In our program we highlight combo box that have to be filled with yellow background.
This worked quite well with code similar to this until now:
BEGIN_MESSAGE_MAP(MyCb, CComboBox)
ON_WM_CTLCOLOR_REFLECT()
END_MESSAGE_MAP()
HBRUSH MyCb::CtlColor(CDC* pDC, UINT nCtlColor)
{
// yellow -> sets the color of the upper part
pDC->SetBkColor(RGB(255,255,0));
pDC->SetBkMode(TRANSPARENT);
// m_brush2 -> not used.
return m_brush2;
}
But on Windows Server 2012 the upper part is not coloured anymore (it works well if style is Dropdown, but not for Drop List).
Any ideas for workarounds?
Thanks, Thomas
View the full article
In our program we highlight combo box that have to be filled with yellow background.
This worked quite well with code similar to this until now:
BEGIN_MESSAGE_MAP(MyCb, CComboBox)
ON_WM_CTLCOLOR_REFLECT()
END_MESSAGE_MAP()
HBRUSH MyCb::CtlColor(CDC* pDC, UINT nCtlColor)
{
// yellow -> sets the color of the upper part
pDC->SetBkColor(RGB(255,255,0));
pDC->SetBkMode(TRANSPARENT);
// m_brush2 -> not used.
return m_brush2;
}
But on Windows Server 2012 the upper part is not coloured anymore (it works well if style is Dropdown, but not for Drop List).
Any ideas for workarounds?
Thanks, Thomas
View the full article