Link to home
Start Free TrialLog in
Avatar of JensHell
JensHell

asked on

Any way to change background color of a readonly CEdit?

Is there Any way to change background color or textcolor of a readonly CEdit?
Avatar of VCStud
VCStud

Hi,

It might be possible to do that in WM_CTLCOLORSTATIC message. That is the message your read only CEdit would send while it is being painted.

Cheers,
VCStud
You actually have do to a little more than that.  You have to correctly handle background painting as well.  For further reference, check out: http://www.codeproject.com/editctrl/enhfocusedit.asp.  That is an older version of my focus-edit control, with additional filtering of keystrokes and pasted text.  But it should give you the information you need to handle painting of the control's background.

-=- James.
Note that the code on this site that processes links is a bit broken, and will include the ending period in the link.  Remove it, or try this one: "http://www.codeproject.com/editctrl/enhfocusedit.asp"

-=- James.
ASKER CERTIFIED SOLUTION
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: sedgwick, DanRollins (points to be split)

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer