TripleState 屬性

此頁沒有內(nèi)容條目
內(nèi)容

expandtri全部顯示

使用 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 屬性。

該屬性在任何視圖中均可設(shè)置。

示例

下面的示例將顯示一則消息,詳細(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