如何正确渲染Control.Enabled =假? [英] How to properly render Control.Enabled = false?

查看:331
本文介绍了如何正确渲染Control.Enabled =假?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一对自定义用户控制,这可以显示文本,或一些其它的元件,并且其是定制渲染(通过重写的OnPaint)。现在,普通的.NET控件(如标签等),变灰,并且看时,他们的Enabled属性设置为false,正确地禁用。我的自定义组件不这样做,仍然显得非常活跃。

I have a couple of custom user controls, which may display text, or some other element, and which are custom rendered (by overriding OnPaint). Now, normal .NET controls (such as Labels, etc), grey out, and 'look' properly disabled when the Enabled property for them is set to false. My custom components do not, and still appear very much active.

我不是100%肯定是什么性质或颜色用于指示等效的禁用的状态,没有人知道?

I'm not 100% sure what properties or colors are used to indicate an equivalent 'disabled' state, does anyone know?

干杯

推荐答案

使用ControlPaint.DrawTextDisabled和放大器; ControlPaint.DrawImageDisabled的方法。

Use ControlPaint.DrawTextDisabled & ControlPaint.DrawImageDisabled methods.

这篇关于如何正确渲染Control.Enabled =假?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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