I have two related OnCtlColor() questions:
1. How do I identify a specific control? I want to change the colors of just one control. I have tried checking pWnd->GetDlgCtrlID() == ID_MAIN_ORGNAME but bizarrely (to me) it then affects only specific controls, but not ID_MAIN_ORGNAME.
2. How do I color the "display window" (not the calendar "picker" -- although that would be okay also) of a Date-Time Control.
I freely admit I don't fully "get" OnCtlColor.
Here's what I have:
HBRUSH CLicensorDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor); if ( pWnd->GetDlgCtrlID() == ID_MAIN_ORGNAME ) //if (nCtlColor == CTLCOLOR_EDIT) { //pDC->SetBkMode(OPAQUE); pDC->SetBkColor(RGB(0,255,0)); pDC->SetTextColor(RGB(255,0,0)); } return hbr; }
Thanks!
Charles