全部显示

TripleState 属性

       

使用 TripleState 属性可以指定复选框切换按钮选项按钮如何显示 Null 值。Boolean 型,可读写。

expression.TripleState

expression   必需。返回“Applies To”列表中的一个对象的表达式。

说明

TripleState 属性使用以下设置:

设置 Visual Basic 说明
True  控件将在“是”、“否”、Null 三种值的状态之间循环。当其 Value 属性设置为 Null 时,控件将显示为暗色(灰色)。
False (默认值)控件将在“是”、“否”两种值的状态之间循环,Null 值显示为“否”。

使用控件的属性表Visual Basic,可以设置 TripleState 属性。

该属性在任何视图中均可设置。

示例

下面的示例将显示一则消息,详细说明“frmOperations”窗体上名为“Check1”的复选框的状态。
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