ReadOnly

是否锁定控件,禁止用户编辑其内容,也就是只读。
BooleanEnum型枚举,包括以下可选值:

示例

例如窗口中有一文本框,如果用户分组为录入员,则禁止编辑其内容,否则由绑定数据源的锁定状态决定是否能编辑。
假定文本框的名称为"txtSale",为实现此要求,可以在窗口的AfterLoad事件中设置如下代码:

Dim txtBox As WinForm.TextBox
txtBox = e.Form.Controls(
"txtSale")
If
User.Group = "录入员" Then
    txtBox.ReadOnly = BooleanEnum.
True
Else

    txtBox.ReadOnly = BooleanEnum.Default

End
If

提示:不是所有的控件都是可以编辑的,此类控件也有ReadOnly属性,但是不会发生任何作用。


本页地址:http://www.foxtable.com/webhelp/topics/0749.htm