I am trying to change the color of static text (and also checkbox items) in a dialog window in my MFC application.
Following this (MFC - change text color of a cstatic text control) and similar suggestions, I did the following on ON_WM_CTLCOLOR()
message:
HBRUSH CMyDialog::OnCtlColor(CDC* pDC, CWnd *pWnd, UINT nCtlColor)
{
pDC->SetTextColor(RGB(255, 0, 0));
return (HBRUSH)GetStockObject(NULL_BRUSH);
}
The problem is that this only affects edit text boxes and not static text or checkboxes. those still have black texts.
I also tried to look for sth similar to winapi's WM_CTLCOLORSTATIC
message as that worked well in win32 applications but did not find any equivalent in MFC. Any idea how to change the color of the static texts and checkbox text?