使用 TripleState 属性可以指定复选框、切换按钮或选项按钮如何显示 Null 值。Boolean 型,可读写。
expression.TripleState
expression 必需。返回“Applies To”列表中的一个对象的表达式。
TripleState 属性使用以下设置:
设置 | Visual Basic | 说明 |
---|---|---|
是 | True | 控件将在“是”、“否”、Null 三种值的状态之间循环。当其 Value 属性设置为 Null 时,控件将显示为暗色(灰色)。 |
否 | False | (默认值)控件将在“是”、“否”两种值的状态之间循环,Null 值显示为“否”。 |
该属性在任何视图中均可设置。
Dim strTripleState As String
strTripleState = Forms.Item("frmOperations").Controls.Item("Check1").TripleState
Select Case strTripleState
Case True
MsgBox "For Check1, TripleState = " & strTripleState & _
". The control will cycle through states for Yes, No, " & _
"and Null values. The control appears dimmed (grayed) " & _
"when its Value property is set to Null."
Case False
MsgBox "For Check1, TripleState = " & strTripleState & _
". The control will cycle through states for Yes and No " & _
"values. Null values display as if they were No values."
Case Else
MsgBox "Can't determine the TripleState property for Check1."
End Select