Implementing the UI Automation Scroll Control Pattern

System_CAPS_ICON_note.jpg Note

This documentation is intended for .NET Framework developers who want to use the managed UI Automation classes defined in the System.Windows.Automation namespace. For the latest information about UI Automation, see Windows Automation API: UI Automation.

This topic introduces guidelines and conventions for implementing IScrollProvider, including information about events and properties. Links to additional references are listed at the end of the topic.

The ScrollPattern control pattern is used to support a control that acts as a scrollable container for a collection of child objects. The control is not required to use scrollbars to support the scrolling functionality, although it commonly does.

Scroll control without scrollbars.
Example of a Scrolling Control that Does Not Use Scrollbars

For examples of controls that implement this control, see Control Pattern Mapping for UI Automation Clients.

When implementing the Scroll control pattern, note the following guidelines and conventions:

The following properties and methods are required for implementing IScrollProvider.

Required memberMember typeNotes

This control pattern has no associated events.

Providers must throw the following exceptions.

Exception TypeCondition
ArgumentExceptionScroll throws this exception if a control supports SmallIncrement values exclusively for horizontal or vertical scrolling, but a LargeIncrement value is passed in.
ArgumentExceptionSetScrollPercent throws this exception when a value that cannot be converted to a double is passed in.
ArgumentOutOfRangeExceptionSetScrollPercent throws this exception when a value greater than 100 or less than 0 is passed in (except -1 which is equivalent to NoScroll).
InvalidOperationExceptionBoth Scroll and SetScrollPercent throw this exception when an attempt is made to scroll in an unsupported direction.

UI Automation Control Patterns Overview
Support Control Patterns in a UI Automation Provider
UI Automation Control Patterns for Clients
UI Automation Tree Overview
Use Caching in UI Automation