Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Does anyone have an easy way to not have the Edit box contents grey when it is disabled?

Thanks in advance.

Stan the man
Posted

1 solution

No, there is no easy way to do this.

First reconsider why you would want to do this. I do not know why you would want to change the look of a disabled CEdit control but your users are going to assume certain things from the look of the control whether they can interact with it like chancing and copying the text.

Consider using SetReadOnly()[^] instead of EnableWindow(FALSE)[^].

If you really want to do this you will have to subclass the CEdit control and add your own drawing logic so you can draw it like you want when the control is disabled.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900