将背景设置为“禁用画笔". [英] Setting Background to "Disabled Brush"

查看:59
本文介绍了将背景设置为“禁用画笔".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这应该很容易.我大多不知道刷子是什么.

我想制作一个文本框(以及其他一些UI元素,如ComboBox,DatePicker),使其看起来好像已被禁用,但实际上已被启用.

我要这样做的原因是我们不喜欢残疾人的行为.例如,没有工具提示,也没有副本等.

我了解这是行为以及原因.但是我们的最终用户希望禁用它,但希望知道它的用途(即仍然需要工具提示),并且他们想要``抓取''活动数据(即复制到缓冲区).
因此,从本质上讲,我们只需要在相应的UI元素上将只读设置为true.但是,然后它似乎已启用(我知道..我知道...原因是).所以我需要让它看起来已禁用.

我想将画笔(文本和背景)的样式设置为残疾人的样式.但是我找不到禁用的背景笔刷,仅是文本笔刷.

http://msdn.microsoft.com/en-us/library/system. windows.systemcolors.graytextbrushkey.aspx [ ^ ]

有人知道它是什么吗?

I know this should be easy. I mostly don''t know what the brush is.

I want to make a Textbox (and some other UI elements like a ComboBox, DatePicker) to look as though they are disabled, but actually be enabled.

The reason I want to do this is we do not like the behavior of disabled. For example, no tooltips, no copy from etc.

I understand that this is the behavior and why. However our end users want it disabled but to be able to know what it is for (i.e. still need tooltips) and they want to ''grab'' the active data (i.e. copy to buffer).
So essentially we just need to set the read only to true on the appropriate UI elements. However, then it looks enabled (I know.. I know... cause it is). So I need it to look disabled.

I want to style the brushes (text and background) to be that of the disabled. However I can''t find the background brush for disabled, just the text brush.

http://msdn.microsoft.com/en-us/library/system.windows.systemcolors.graytextbrushkey.aspx[^]

Anybody know what it is?

推荐答案

背景只是控件所在窗口的颜色.我假设您的意思是,例如,在编辑控件中通常是白色区域,当该控件被禁用时,它将变为包含窗口的背景色.
The background is just the color of whatever window the control is on. I assume you mean, for example, what would normally be the white area in an edit control, it turns to the containing window''s background color when that control is disabled.


这篇关于将背景设置为“禁用画笔".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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