UI Automation Support for the Spinner Control Type

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 provides information about UI Automation support for the Spinner control type. In UI Automation, a control type is a set of conditions that a control must meet in order to use the ControlTypeProperty property. The conditions include specific guidelines for UI Automation tree structure, UI Automation property values and control patterns.

Spinner controls are used to select from a domain of items or a range of numbers.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the Spinner control type. The UI Automation requirements apply to all spinner controls, whether Windows Presentation Foundation (WPF), Win32, or Windows Forms.

The following table depicts the control view and the content view of the UI Automation tree that pertain to spinner controls when they support the Range Value, Value, and Selection control patterns and describes what can be contained in each view. For more information on the UI Automation tree, see UI Automation Tree Overview.

Range Value or Value control pattern

Control ViewContent View

- Edit (0 or 1)
- Button (2)

Selection control pattern

Control ViewContent View

- Edit (0 or 1)
- Button (2)
- List Item (0 or more)

- ListItem (0 or more)

To ensure that the two buttons in the control view subtree can be distinguished by automated test tools, assign the SmallIncrement or SmallDecrement``AutomationId as appropriate. For some implementations, the associated Edit control may be a peer of the Spinner control.

The following table lists the UI Automation properties whose value or definition is especially relevant to spinner controls. For more information on UI Automation properties, see UI Automation Properties for Clients.

UI Automation PropertyValueNotes
AutomationIdPropertySee notes.The value of this property needs to be unique across all controls in an application.
BoundingRectanglePropertySee notes.The outermost rectangle that contains the whole control.
ClickablePointPropertySee notes.The spinner control's clickable point gives focus to the edit portion of the control.
IsKeyboardFocusablePropertySee notes.If the control can receive keyboard focus, it must support this property.
NamePropertySee notes.The spinner control typically gets its name from a static text label.
LabeledByPropertySee notes.Spinner controls have a static text label.
ControlTypePropertySpinnerThis value is the same for all UI frameworks.
LocalizedControlTypeProperty"spinner"Localized string corresponding to the Spinner control type.
IsContentElementPropertyTrueThe spinner control must always be content.
IsControlElementPropertyTrueThe Spinner control must always be a control.

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

Control Pattern/Pattern PropertySupport/ValueNotes
ISelectionProviderDependsSpinner controls that have a list of items to be selected must support this pattern.
CanSelectMultipleFalseSpinner controls are always single selection containers.
IRangeValueProviderDependsSpinner controls that span a numeric range can support this pattern.
IValueProviderDependsSpinner controls that span a discrete set of options or numbers can support this pattern.

The following table lists the UI Automation events required to be supported by all spinner controls. For more information on events, see UI Automation Events Overview.

UI Automation EventSupportNotes
BoundingRectangleProperty property-changed event.RequiredNone
IsOffscreenProperty property-changed event.RequiredNone
IsEnabledProperty property-changed event.RequiredNone
ValueProperty property-changed event.DependsNone
ValueProperty property-changed event.DependsNone

UI Automation Control Types Overview
UI Automation Overview