Windows应用程序 - 只读 [英] Windows application - read only

查看:71
本文介绍了Windows应用程序 - 只读的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文本框具有ReadOnly的属性。这看起来像是一个简单的

概念。当文本框设置为只读时,用户无法更改该字段的

内容。


我一直试图找到其他预定义的丢失能力

控制C#。 radiobutton,checkbox和combobox控件不会分享此功能。我发现很难相信这个功能被遗漏了,并且微软希望每个人都编写自己的实现

这些控件来处理缺少的功能。


每个控件都共享Enabled的属性。不幸的是,当呈现

控件时,处于禁用状态时很难读取。我已经找到了一种方法来覆盖它,但收效甚微。


我是否遗漏了某些内容,或者是在
其他控件是自己编码吗?


谢谢

Dan





A textbox has a attribute for ReadOnly. This seems like such a simple
concept. When a textbox is set to read only the user cannot change the
contents of the field.

I have been trying to find that missing ability for other predefined
controls in C#. The radiobutton, checkbox, and combobox controls do not
share this ability. I find it difficult to believe that this feature was
left out and Microsoft expects everyone to write their own implementation of
these controls to handle the missing functionality.

Every control shares the attribute for Enabled. Unfortunately when the
control is rendered it is difficult to read when in a disabled state. I
have looked for a way to override this with little success.

Am I missing something or is the only way to have a ReadOnly ability on
other controls is to code this myself?

Thanks
Dan





推荐答案

Dan,


readonly属性来自TextBox(带有设置外观)

种类的多行标签。


我没有看到Combobox,Ceckbox或Radiobutton的目的,

你能不能为我启发。

在我的想法中,在这些情况下使用readonly只会让客户

来报告错误。


Cor


Dan Tallent < sp ** @ microsoft.comschreef in bericht

news:O
Dan,

The readonly property makes from a TextBox (with setting the appearance) a
kind of multiline label.

I don''t see the purpose of that for a Combobox, a Ceckbox or a Radiobutton,
can you enlighten that missing for me.
In my idea would the use of readonly in these cases only make the customer
to report bugs.

Cor

"Dan Tallent" <sp**@microsoft.comschreef in bericht
news:O


************** @ TK2MSFTNGP02。 phx.gbl ...
**************@TK2MSFTNGP02.phx.gbl...

>文本框具有ReadOnly的属性。这似乎是一个如此简单的概念。当一个文本框设置为只读时,用户无法更改该字段的内容。


我一直试图找到其他预定义的缺失能力

控制在C#中。 radiobutton,checkbox和combobox控件不会分享此功能。我发现很难相信这个功能被遗漏了,微软希望每个人都能编写自己的这些控件的实现来处理缺少的功能。


每个控件都共享Enabled的属性。不幸的是,当呈现

控件时,处于禁用状态时很难读取。我已经找到了一种方法来覆盖它,但收效甚微。


我是否遗漏了某些内容,或者是在
其他控件是自己编码吗?


谢谢

Dan




>A textbox has a attribute for ReadOnly. This seems like such a simple
concept. When a textbox is set to read only the user cannot change the
contents of the field.

I have been trying to find that missing ability for other predefined
controls in C#. The radiobutton, checkbox, and combobox controls do not
share this ability. I find it difficult to believe that this feature
was left out and Microsoft expects everyone to write their own
implementation of these controls to handle the missing functionality.

Every control shares the attribute for Enabled. Unfortunately when the
control is rendered it is difficult to read when in a disabled state. I
have looked for a way to override this with little success.

Am I missing something or is the only way to have a ReadOnly ability on
other controls is to code this myself?

Thanks
Dan





有时候你想在这些控件中显示信息

然而查看数据的用户没有有意改变。这个

将是一个简单地将控件标记为只读的好地方,允许用户查看但不更改这些设置。开发人员(我)可以

然后编写一次用户界面,只需要根据需要将字段标记为

只读。如果您要使用其他控件(文本框)来显示当前值,现在您为屏幕的每个

变体生成不同的UI。


示例:

用户A可以更改任何值

用户B可以更改屏幕左侧的所有值

用户C可以更改屏幕右侧的所有值。

用户D不能更改任何值。


4个不同级别的权限,但将正确的控件设置为

readonly可以很容易地解决这个问题。


这有助于它有意义吗?


Dan


" Cor Ligthert [MVP]" < no ************ @ planet.nlwrote in message

news:35 ****************** **************** @ microsof t.com ...
There are times when you want to show information within these controls
however the user viewing the data does not have privledges to change. This
would be a good place to simply mark the controls as readonly which allow
the user to view but not change these settings. The developer (me) could
then write the user interface once and only have to mark the fields as
read-only as needed. IF you were to use other controls (textboxes) to
display the current value, now your producing a different UI for each
variation of the screen.

Example:
User A can change any of the values
User B can change all the values on the left side of the screen
User C can change all the values on the right side of the screen.
User D can NOT change any of the values.

4 different levels of permission but setting the correct controls to
readonly would easily handle this.

Does that help it make sense?

Dan

"Cor Ligthert[MVP]" <no************@planet.nlwrote in message
news:35**********************************@microsof t.com...

Dan,


readonly属性来自TextBox(设置外观)一种

种类的多行标签。


我没看到对于一个Combobox,一个Ceckbox或一个
Radiobutton的目的,你能为我启发那个缺失。

在我的想法中,在这些情况下只使用readonly客户

报告错误。


Cor


" Dan Tallent" < sp ** @ microsoft.comschreef in bericht

news:O
Dan,

The readonly property makes from a TextBox (with setting the appearance) a
kind of multiline label.

I don''t see the purpose of that for a Combobox, a Ceckbox or a
Radiobutton, can you enlighten that missing for me.
In my idea would the use of readonly in these cases only make the customer
to report bugs.

Cor

"Dan Tallent" <sp**@microsoft.comschreef in bericht
news:O


这篇关于Windows应用程序 - 只读的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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