If e.form.controls("ComboBox1").value = "窗口" Then
e.form.controls("TextBox2").ReadOnly = BooleanEnum.True''菜单区
e.form.controls("TextBox3").ReadOnly = BooleanEnum.True''菜单组
e.form.controls("TextBox4").ReadOnly = BooleanEnum.True''菜单件
e.form.controls("TextBox1").ReadOnly = BooleanEnum.True''表名
e.form.controls("TextBox8").ReadOnly = BooleanEnum.True''列名
ElseIf e.form.controls("ComboBox1").value = "表" Then
e.form.controls("TextBox2").ReadOnly = BooleanEnum.True
e.form.controls("TextBox3").ReadOnly = BooleanEnum.True
e.form.controls("TextBox4").ReadOnly = BooleanEnum.True
e.form.controls("TextBox5").ReadOnly = BooleanEnum.True
e.form.controls("TextBox6").ReadOnly = BooleanEnum.True
ElseIf e.form.controls("ComboBox1").value = "菜单" Then
e.form.controls("TextBox5").ReadOnly = BooleanEnum.True
e.form.controls("TextBox6").ReadOnly = BooleanEnum.True
e.form.controls("TextBox1").ReadOnly = BooleanEnum.True
e.form.controls("TextBox8").ReadOnly = BooleanEnum.True
End If
其它的要设置为false哦,所有控件都要设置
If e.form.controls("ComboBox1").value = "窗口" Then
e.form.controls("只读的控件").ReadOnly = BooleanEnum.True
e.form.controls("可编辑的控件").ReadOnly = BooleanEnum.False