ComboBox 控件ComboBox control

组合了 ListBoxTextBox 的功能。Combines the features of a ListBox and a TextBox. 用户可以输入新值, 就像使用TextBox一样, 或者用户可以选择现有值, 就像使用ListBoxThe user can enter a new value, as with a TextBox, or the user can select an existing value, as with a ListBox.

备注Remarks

如果combobox 绑定数据源, 则combobox将插入用户在该数据源中输入或选择的值。If a ComboBox is bound to a data source, the ComboBox inserts the value the user enters or selects into that data source. 如果绑定了多列组合框, 则BoundColumn属性将确定在绑定的数据源中存储的值。If a multi-column combo box is bound, the BoundColumn property determines which value is stored in the bound data source.

ComboBox 中的列表由数据行组成。The list in a ComboBox consists of rows of data. 每行可以有一列或多列,可以显示也可以不显示列标题。Each row can have one or more columns, which can appear with or without headings. 一些应用程序不支持列标题,其他应用程序仅提供有限支持。Some applications do not support column headings, others provide only limited support.

ComboBox 的默认属性为 Value 属性。The default property of a ComboBox is the Value property. ComboBox 的默认事件为 Change 事件。The default event of a ComboBox is the Change event.

备注

[!注释] 如果您希望始终显示列表的多个行,则可能希望使用 ListBox 而不是 ComboBoxIf you want more than a single line of the list to appear at all times, you might want to use a ListBox instead of a ComboBox. 如果您希望使用 ComboBox 并将值限制为列表中的值,则可设置 ComboBoxStyle 属性,以便控件看上去像下拉列表框。If you want to use a ComboBox and limit values to those in the list, you can set the Style property of the ComboBox so the control looks like a drop-down list box.

另请参阅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.