禁用表单控件 [英] Disabling form controls

查看:70
本文介绍了禁用表单控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以禁用表单控件(例如文本框)而不影响它的前景色和背景色

(我希望它看起来一样,但不允许用户输入。


Miriam

Is it possible to disable a form control (eg. text box) without affecting it''s foreground and background colors
(I want it to look the same, but disallow user input.

Miriam

推荐答案

尝试文本框上的readonly属性...我不确定那里'是一个用于组合框的..
try the readonly property thats on textbox..i''m not sure there''s one for comboboxes..


* =?Utf-8?B?TWlyaWFt?=< an ******* @ discussion.microsoft.com> ; scripsit:
* =?Utf-8?B?TWlyaWFt?= <an*******@discussions.microsoft.com> scripsit:
是否可以禁用表单控件(例如文本框)而不影响它的前景色和背景色?
(我希望它看起来一样,但是不允许用户输入。)
Is it possible to disable a form control (eg. text box) without affecting it''s foreground and background colors?
(I want it to look the same, but disallow user input.)




至少对于文本框:将其''ReadOnly''属性设置为''True''和

重置forecolor和backcolor。


更好的方法是更改​​系统的颜色设置:-)。


-

Herfried K. Wagner [MVP]

< URL:http://dotnet.mvps.org/>



At least for the textbox: Set its ''ReadOnly'' property to ''True'' and
reset forecolor and backcolor.

The better way is to change the system''s color settings :-).

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>


您甚至不需要更改前/后颜色。

----- Herfried K. Wagner [MVP]写道:----


* =?Utf-8?B?TWlyaWFt?=< an *******@discussions.microsoft.com> scripsit
you dont even need to change the fore/back colors.

----- Herfried K. Wagner [MVP] wrote: ----

* =?Utf-8?B?TWlyaWFt?= <an*******@discussions.microsoft.com> scripsit
是否可以禁用表单控件(例如文本框)而不影响它的前景色和背景色
(我希望它看起来一样,但不允许用户输入。
Is it possible to disable a form control (eg. text box) without affecting it''s foreground and background colors
(I want it to look the same, but disallow user input.




至少对于文本框:将其''ReadOnly''属性设置为''True''

重置forecolor和backcolor


更好的方法是更改​​系统的颜色设置:-)


-

Herfried K. Wagner [MVP

< URL:http://dotnet.mvps.org/>



At least for the textbox: Set its ''ReadOnly'' property to ''True'' an
reset forecolor and backcolor

The better way is to change the system''s color settings :-)

--
Herfried K. Wagner [MVP
<URL:http://dotnet.mvps.org/>


这篇关于禁用表单控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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