Hi,
I used the following overloaded method to change the text color to red in a listbox, in a Visual C++ MFC dialog based application. When I build the program in DEBUG mode, it works perfectly. But when I use the RELEASE mode the text color doesn't change. Why is this and how can I overcome this problem??
Thanks!!
HBRUSH MyDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
if(nCtlColor == CTLCOLOR_LISTBOX)
{
if(bChangeTextColor)
{
pDC->SetTextColor(RGB(255, 0, 0));
return m_hRedBrush;
}
}
return CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}