使用 TripleState 屬性可以指定復(fù)選框、切換按鈕或選項(xiàng)按鈕如何顯示 Null 值。Boolean 型,可讀寫。
expression.TripleState
expression 必需。返回“應(yīng)用于”列表中的一個對象的表達(dá)式。
TripleState 屬性使用以下設(shè)置:
設(shè)置 |
Visual Basic |
說明 |
是 |
True |
控件將在“是”、“否”、Null 三種值的狀態(tài)之間循環(huán)。當(dāng)其 Value 屬性設(shè)置為 Null 時,控件將顯示為暗色(灰色)。 |
False |
(默認(rèn)值)控件將在“是”、“否”兩種值的狀態(tài)之間循環(huán),Null 值顯示為“否”。 |
注釋 使用控件的屬性表、宏或 Visual Basic,可以設(shè)置 TripleState 屬性。
下面的示例將顯示一則消息,詳細(xì)說明“frmOperations”窗體上名為“Check1”的復(fù)選框的狀態(tài)。
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