Re: ! Colored Edit Boxes !
Hi,
the control is not redrawn when You call SetColors. So the control has the color You want it to have but You can only see an older state. Call one of the functions that cause the edit box to redraw (I never know which one to use).
You can test whether it is the only reason (I can't see another one) in hiding the control behind another window and removing this window then.
HTH Rudolf
Re: ! Colored Edit Boxes !
I did something very similar to yours except my SetColors looks like:
void CBlueEdit::SetColors(COLORREF Fg, COLORREF Bg) {
m_clrText = Fg;
m_clrBkgnd = Bg;
if ((HBRUSH)m_brBkgnd)
m_brBkgnd.DeleteObject();
m_brBkgnd.CreateSolidBrush(m_clrBkgnd);
}
I am not sure if the DeleteObject is necessary, though.
And I define m_clrText and m_clrBkgnd as COLORREF.
Re: ! Colored Edit Boxes !
Great! Thanks a lot, works like a charm.
- chris