开发者

changing font color of text in a disabled CEdit control

开发者 https://www.devze.com 2023-01-21 15:08 出处:网络
I want to change the font color of text in a disabled CEdit control which is currently system gray. As I use a gray background, I wish to change the font color of 开发者_开发百科text ( currently set

I want to change the font color of text in a disabled CEdit control which is currently system gray.

As I use a gray background, I wish to change the font color of 开发者_开发百科text ( currently set to rgb value of COLOR_GRAYTEXT) in order to make it easier to read.

There is a solution by using SetSysColors() but that has an ill effect of changing that value for all the applications that are running.Does anyone knows of a better solution?

I tried handling the WM_CTLCOLORSTATIC/ WM_CTLCOLOREDIT message, but the SetTextColor() method didn`t seem to work and application continued to use the system graytext. Does anyone knows the right way to do this?

0

精彩评论

暂无评论...
验证码 换一张
取 消