Re: CEdit custom painting ?
Hi,
you have to create a message handler for the message ON_WM_CTLCOLORREFLECT and then you can set the text and back color like this:
HBRUSH CMyEdit::CtlColor(CDC* pDC, UINT nCtlColor)
{
pDC->SetTextColor(textcol);
pDC->SetBkColor(backcol);
return brush; // brush is a CBrush object, created with CreateSolidBrush(backcol)
}
Greetings, Jörg
Re: CEdit custom painting ?
Sorry, we misunderstood. The problem is not setting the colors (it works great the way you described), but doing custom painting (not only changing some colors) inside the CEdit (here: drawing some static, gayed text when the control ist "empty").
Thank you for your reply and I hope it's now more clearly what I want to do.