I have CDialg and CEdit Control on dialog. So, to paint CEdit control without sub-classing CEdit Class, I used CDialog::OnCtlColor
like this.
if( nCtlColor == CTLCOLOR_EDIT )
{
pDC->SetBkColor(RGB(200, 255, 200));
}
But as you can see, that it omits some margin area of edit control.
How can I paint it whole window Rect of CEdit?
You also need to return a brush with the correct colour, so create a brush in the dialog constructor
and in the
OnCtlColor()
function,