適用対象
CheckBox オブジェクト |
OptionButton オブジェクト |
ToggleButton オブジェクト |
"TripleState/トリプルステート" プロパティを使用して、チェック ボックス、トグル ボタン、またはオプション ボタンで Null 値を表示する方法を指定できます。 ブール型の値の読み取り/書き込みが可能です。
expression.TripleState
expression 必ず指定します。 [適用先] リスト内のいずれかのオブジェクトを返す式。
解説
"TripleState/トリプルステート" プロパティでは、次の設定が使用されます。
設定 |
Visual Basic |
説明 |
Yes/はい |
True |
コントロールは、Yes、No、および Null の状態値が循環します。 "Value/値" プロパティが "Null" に設定されている場合、コントロールは淡色表示されます。 |
No |
False |
(既定) コントロールは、Yes と No の状態値が循環します。 Null 値は、No 値のように表示されます。 |
注: "TripleState/トリプルステート" プロパティを設定するには、コントロールのプロパティ シート、マクロ、または Visual Basic for Applications (VBA) コードを使用します。
このプロパティは、任意のビューで設定できます。
例
次の例では、フォーム "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