使用 TripleState 属性可指定指定控件如何显示 Null 值。 读/写 Boolean。
语法
表达式。TripleState
表达 一个代表 CheckBox 对象的变量。
备注
Null 属性使用下列设置。
| Setting | 说明 |
|---|---|
| True | 控件将循环访问 “是”、“ 否”和 “Null” 值的状态。 当控件 的 Value 属性设置为 Null 时,控件显示为灰色 (灰色) 。 |
| False | (默认) 控件将循环访问 “是” 和“ 否 ”值的状态。 Null 值显示为 No 值。 |
此属性在任何视图中均可设置。
示例
以下示例显示一条消息,详细描述 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
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。