更改禁用的 CEdit 控件中文本的字体颜色

发布于 2024-09-28 12:45:36 字数 296 浏览 0 评论 0原文

我想更改禁用的 CEdit 控件中文本的字体颜色,该控件当前为系统灰色。

由于我使用灰色背景,我希望更改文本的字体颜色(当前设置为 COLOR_GRAYTEXT 的 rgb 值)以使其更易于阅读。

有一个使用 SetSysColors() 的解决方案,但这会对所有正在运行的应用程序更改该值产生不良影响。有谁知道更好的解决方案吗?

我尝试处理 WM_CTLCOLORSTATIC/ WM_CTLCOLOREDIT 消息,但 SetTextColor() 方法似乎不起作用,应用程序继续使用系统灰文本。有谁知道执行此操作的正确方法?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文