OptionButton 控件OptionButton control

显示选项中某个项目的选择状态。Shows the selection status of one item in a group of choices.

备注Remarks

使用 OptionButton 可以显示是否选中了组中的某个项目。Use an OptionButton to show whether a single item in a group is selected. 请注意,同一 Frame 中的每个 OptionButton 都是互斥的。Note that each OptionButton in a Frame is mutually exclusive.

如果选项按钮绑定数据源, 则该选项按钮可以将该数据源的值显示为 "是"、"/__/" 或 "开/ "OffIf an OptionButton is bound to a data source, the OptionButton can show the value of that data source as either Yes/No, True/False, or On/Off.

如果用户选择 OptionButton,则当前设置为 YesTrueOn;如果用户不选择 OptionButton,则设置为 NoFalseOffIf the user selects the OptionButton, the current setting is Yes, True, or On; if the user does not select the OptionButton, the setting is No, False, or Off. 例如,库存跟踪应用程序中的 OptionButton 可能显示某个商品是否已停产。For example, an OptionButton in an inventory-tracking application might show whether an item is discontinued. 如果将选项按钮绑定到数据源, 则更改设置将更改该数据源的值。If the OptionButton is bound to a data source, changing the settings changes the value of that data source. 禁用的 OptionButton 淡显且不显示值。A disabled OptionButton is dimmed and does not show a value.

根据**TripleState** 属性的值,选项按钮也可以具有null值。Depending on the value of the TripleState property, an OptionButton can also have a null value.

You can also use an OptionButton inside a group box to select one or more of a group of related items.You can also use an OptionButton inside a group box to select one or more of a group of related items. 例如,您可以创建一个包含供应商品指令清单的订单窗体,每个商品前有一个 OptionButtonFor example, you can create an order form with a list of available items, with an OptionButton preceding each item. 用户可以通过选中相应的 OptionButton 来选择特定商品。The user can select a particular item by checking the corresponding OptionButton.

OptionButton 的默认属性是 Value 属性。The default property for an OptionButton is the Value property. OptionButton 的默认事件是 Click 事件。The default event for an OptionButton is the Click event.

另请参阅See also

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.