只读和启用之间的主要区别是什么? [英] What is the main difference between ReadOnly and Enabled?
问题描述
在 Windows窗体控件,有两个属性:只读的和的已启用的
In Windows Forms controls, there are two properties: ReadOnly and Enabled.
什么是这两个属性之间的区别?我觉得他们的行为方式相同
What is the difference between these two properties? I feel like they behave the same way.
推荐答案
由于它说,在下面的论坛上发帖:
As it says in the following forum post:
在一个文本框的背景下,只读
允许用户将焦点设置到和
选择并复制文本,但不是
修改它。禁用的文本框没有
允许任何任何干预。
In the context of a TextBox, readonly allows the user to set focus to and select and copy the text but not modify it. A disabled TextBox does not allow any interaction whatsoever.
当你有B您希望用户看到和副本$ B $的数据使用只读,但
不能修改。使用禁用的文本框,当您在显示数据为
不适用在对话框或窗口的当前
状态
Use ReadOnly when you have data that you want the user to see and copy, but not modify. Use a disabled textbox, when the data you are displaying is not applicable in for the current state of a dialog or window.
来自 MSDN论坛
这篇关于只读和启用之间的主要区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!