ScrollBar Control Type

This topic provides information about Microsoft UI Automation support for the ScrollBar control type.

Scroll bar controls enable a user to scroll content within a window or item container. The control consists of a set of buttons and a thumb control.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the ScrollBar control type. The UI Automation requirements apply to all scroll bar controls where the UI framework/platform integrates UI Automation support for control types and control patterns.

This topic contains the following sections.

Typical Tree Structure

The following table depicts a typical control and content view of the UI Automation tree that pertains to scroll bar controls and describes what can be contained in each view. For more information about the UI Automation tree, see UI Automation Tree Overview.

Control ViewContent View
  • ScrollBar
    • Button (0, 2, or 4)
    • Thumb (0 or 1)
Not applicable. (The scroll bar control has no content.)


The scroll bar control can have zero to five children. Because the subtree has more than one button control, the element must set a specific UIA_AutomationIdPropertyId value to each item to make them discoverable for automated testing tools.

Relevant Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to scroll bar controls. Note that a scroll bar control never has content; its functionality is exposed through the Scroll control pattern, which is supported on the container being scrolled.

For more information about UI Automation properties, see Retrieving Properties from UI Automation Elements.

UI Automation PropertyValueNotes
UIA_AutomationIdPropertyIdSee notes.The value of this property must be unique among all peer elements in the raw view of the UI Automation tree.
UIA_BoundingRectanglePropertyIdSee notes.The outermost rectangle that contains the whole control.
UIA_ClickablePointPropertyIdNaNThe scroll bar control does not have clickable points.
UIA_ControlTypePropertyIdScrollBarThis value is the same for all frameworks. Scroll bars that function as sliders must use the Slider control type.
UIA_IsContentElementPropertyIdFALSEThe scroll bar control is never a content element. If the scroll bar is a standalone control, it must fulfill the Slider control type and return UIA_SliderControlTypeId for the IUIAutomationElement::CurrentControlType (or CachedControlType) property.
UIA_IsControlElementPropertyIdTRUEThe scroll bar control is always included in the control view of the UI Automation tree.
UIA_IsKeyboardFocusablePropertyIdSee notes.If the control can receive keyboard focus, it must support this property. A scroll bar control rarely takes the focus, but when it does, the focus should remain on the scroll bar control itself, not on the child buttons or the thumb. The user should be able to perform all scrolling actions by using the UP ARROW and DOWN ARROW (or RIGHT ARROW and LEFT ARROW) keys, or the PAGE UP and PAGE DOWN keys.
UIA_LabeledByPropertyIdNULLScroll bars do not have labels.
UIA_LocalizedControlTypePropertyIdSee notes.Localized string corresponding to the ScrollBar control type. The default value is "scroll bar" for en-US or English (United States).
UIA_NamePropertyIdNULLThe scroll bar control does not have content elements and the UIA_NamePropertyId property is not required to be set.
UIA_OrientationPropertyIdSee notes.The scroll bar control must always expose its horizontal or vertical orientation.


Required Control Patterns

The following table lists the UI Automation control patterns required to be supported by all scroll bar controls. For more information on control patterns, see UI Automation Control Patterns Overview.

Note  When a scroll bar is used as a control for mouse manipulation only, it does not support control patterns. If it is used as a slider control within an application, it must be given the Slider control type.
Control PatternSupportNotes
IRangeValueProvider DependsThe RangeValue control pattern is required to be supported only if the Scroll control pattern is not supported on the container that has the scroll bar.
IScrollProvider NeverThe Scroll control pattern is never directly supported on the scroll bar.


Required Events

The following table lists the UI Automation events that scroll bar controls are required to support. For more information on events, see UI Automation Events Overview.

UI Automation EventNotes
UIA_BoundingRectanglePropertyId property-changed event.
UIA_IsEnabledPropertyId property-changed event.If the control supports the IsEnabled property, it must support this event.
UIA_IsOffscreenPropertyId property-changed event.If the control supports the IsOffscreen property, it must support this event.
UIA_RangeValueValuePropertyId property-changed event.If the control supports the RangeValue control pattern, it must support this event.


Related topics

UI Automation Control Types Overview
UI Automation Overview