ScrollBar Control

Description

Returns or sets the value of another control based on the position of the scroll box.

Remarks

A ScrollBar is a stand-alone control you can place on a form. It is visually like the scroll bar you see in certain objects such as a ListBox or the drop-down portion of a ComboBox. 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 ScrollBar's events and methods. 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.

The default property for a ScrollBar is the Value property.

The default event for a ScrollBar is the Change event.

Note To create a horizontal or vertical ScrollBar, drag the sizing handles of the ScrollBar horizontally or vertically on the form.

Properties

BackColor property, BoundValue property, ControlSource property, ControlTipText property, Delay property, Enabled property, ForeColor property, Height, Width properties, HelpContextID property, LargeChange property, LayoutEffect property, Left, Top properties, Max, Min properties, MouseIcon property, MousePointer property, Name property, Object property, OldHeight, OldWidth properties, OldLeft, OldTop properties, Orientation property, Parent property, ProportionalThumb property, SmallChange property, TabIndex property, TabStop property, Tag property, Value property, Visible property.

Methods

Move method, SetFocus method, ZOrder method.

Events

AfterUpdate event, BeforeDragOver event, BeforeUpdate event, Change event, Enter, Exit events, Error event, KeyDown, KeyUp events, KeyPress event, Scroll event.

See Also

SpinButton control.

Example

See the Scroll event example.