ScrollBar 控件ScrollBar control

根据滚动框的位置返回或设置其他控件的值。Returns or sets the value of another control based on the position of the scroll box.

备注Remarks

ScrollBar 是可放置到窗体上的独立控件。A ScrollBar is a stand-alone control you can place on a form. 外观上像某些对象(如 ListBox ,或者 ComboBox 中的下拉部分)中的滚动条。It is visually like the scroll bar you see in certain objects such as a ListBox or the drop-down portion of a ComboBox. 但是,与这些示例中的滚动条不同,独立 ScrollBar 不是任何其他控件的主要部分。However, unlike the scroll bars in these examples, the stand-alone ScrollBar is not an integral part of any other control.

若要使用滚动条设置或读取另一个控件的值, 必须为滚动条的事件和方法编写代码。To use the ScrollBar to set or read the value of another control, you must write code for the events and methods of the ScrollBar. 例如, 若要使用滚动条更新**textbox** 的值, 您可以编写代码来读取滚动条Value属性, 然后设置TextBoxvalue属性。For example, to use the ScrollBar to update the value of a TextBox, you can write code that reads the Value property of the ScrollBar and then sets the Value property of the TextBox.

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

备注

若要创建水平或垂直的 ScrollBar,请在窗体上水平或垂直拖动 ScrollBar 的大小句柄。To create a horizontal or vertical ScrollBar, drag the sizing handles of the ScrollBar horizontally or vertically on the form.

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