-
WM_CTLCOLOREDIT Problem
Alright, when an EDIT control gets that message, I deal with it like this:
SetTextColor( (HDC)wParam, cset->Foreground() );
SetBkMode( (HDC)wParam, cset->BackgroundMode() );
SetBkColor( (HDC)wParam, cset->Background() );
logBrush.lbColor = cset->Background() ;
hBrush = CreateBrushIndirect(&logBrush);
cset = 0;
return (long)hBrush;
cset foreground, background both return a COLORREF RGB Value
BackgroundMode return TRANSPARENT.
This works for all controls, except...THE EDIT!!!
This cause's every problem in the last of my posts about the Edit Control.
The problem: (stage before--> text in box)
[en]"Homer"
press enter where en is, should move Homer down 1 line. but:
"Homer"
"Homer"
it copy's the word until I redraw.....WHY?!?!
If I do not set the above the code on the EDIT then this problem is eliminated.
-
The Edit control recieves that message before it is drawn. You have to redraw it or it won't change..
Phreak
-
well, the background changes and the text changes just fine.
The text box is just forever messed up when I try and type into it.
-
It seems I was changing the text background mode in the EDIT control to TRANSPARENT...that was the problem.
OPAQUE or just leave it alone and it works fine with the new background colors.
Such a small thing cause'd me many days grief.