CEdit-MFC-EnableWindow(FALSE)时如何不使内容变灰 [英] CEdit - MFC - How to not have greying of the contents when EnableWindow(FALSE)

查看:228
本文介绍了CEdit-MFC-EnableWindow(FALSE)时如何不使内容变灰的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人禁用禁用编辑"框内容的灰色框,这是一种简单的方法吗?

提前谢谢.

Stan the man

Does anyone have an easy way to not have the Edit box contents grey when it is disabled?

Thanks in advance.

Stan the man

推荐答案

不,没有简单的方法可以做到这一点.

首先重新考虑为什么要这样做.我不知道您为什么要更改禁用的CEdit控件的外观,但是您的用户将从控件的外观中假设某些事情,他们是否可以与它进行交互,例如调整和复制文本. >
考虑使用 SetReadOnly() [ EnableWindow(FALSE) [
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.


这篇关于CEdit-MFC-EnableWindow(FALSE)时如何不使内容变灰的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆