|
-
Oct 28th, 2004, 07:22 PM
#1
Thread Starter
PowerPoster
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.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
-
Oct 28th, 2004, 11:22 PM
#2
The Edit control recieves that message before it is drawn. You have to redraw it or it won't change..
Phreak
Visual Studio 6, Visual Studio.NET 2005, MASM
-
Oct 30th, 2004, 12:41 AM
#3
Thread Starter
PowerPoster
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.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
-
Oct 30th, 2004, 01:20 PM
#4
Thread Starter
PowerPoster
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.
"From what was there, and was meant to be, but not of that was faded away." - - Steve Damm
"The polar opposite of nothingness is existance. When existance calls apon nothingness it shall return to nothingness." - - Steve Damm
"When you do things right, people won't be sure if you did anything at all." - - God from Futurama
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|