Compartilhar via


UI Automation Support for the ScrollBar Control Type

Observação

Esta documentação destina.Os desenvolvedores do NET Framework que desejam usar o gerenciado UI Automation classes definidas na System.Windows.Automation namespace.As informações mais recentes sobre UI Automation, consulte API de automação do Windows: Automação da interface do usuário.

Este tópico fornece informações sobre UI Automation suporte para a barra de rolagem o tipo de controle. 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.

Scroll bar controls enable a user to scroll content within a window or item container. The control is made up 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 list controls, whether Windows Presentation Foundation (WPF), Win32, or Windows Forms.

Este tópico contém as seguintes seções.

  • Required UI Automation Tree Structure
  • Required UI Automation Properties
  • Required UI Automation Control Patterns
  • Required UI Automation Events
  • Tópicos relacionados

Required UI Automation Tree Structure

The following table depicts the control view and the 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 on the UI Automation tree, see Visão geral da árvore de automação de interface do usuário.

Control View

Content View

ScrollBar

  • Button (2 or 4)

  • Thumb (0 or1)

Not applicable. The scroll bar control does not contain content.

The scroll bar control always has three to five children. Because the subtree has more than one button control, you must set a specific AutomationIdProperty value to each item to make them discoverable for test automation tools.

Required UI Automation 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 UI Automation Properties for Clients.

UI Automation Property

Value

Notes

AutomationIdProperty

See notes.

The value of this property needs to be unique across all controls in an application.

BoundingRectangleProperty

See notes.

The outermost rectangle that contains the whole control.

IsKeyboardFocusableProperty

See notes.

If the control can receive keyboard focus, it must support this property.

NameProperty

Null

The scroll bar control does not have content elements and the NameProperty is not required to be set.

ClickablePointProperty

Not a number.

The scroll bar control does not have clickable points.

LabeledByProperty

Null

Scroll bars do not have labels.

ControlTypeProperty

ScrollBar

This value is the same for all frameworks. Scroll bars that function as sliders must use the Slider control type.

LocalizedControlTypeProperty

"scroll bar"

Localized string that corresponds to the Button control type.

IsContentElementProperty

False

The scroll bar control is never a content element. If the scroll bar is a standalone control, then it must fulfill the Slider control type and return ControlType.Slider for the ControlType property.

IsControlElementProperty

True

The scroll bar must always be a control.

OrientationProperty

True

The scroll bar control must always expose its horizontal or vertical orientation.

Required UI Automation Control Patterns

A tabela a seguir listas os UI Automation padrões de controle necessário para ser suportadas por controles da barra de rolagem. For more information on control patterns, see Visão Geral de Padrões de Controle de Automação de Interface de Usuário. Note that 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.

Padrão de controle

Support

Notes

IScrollProvider

Never

The Scroll control pattern is never directly supported on the scroll bar.

IRangeValueProvider

Depends

This functionality is required to be supported only if the Scroll control pattern is not supported on the container that has the scroll bar.

Required UI Automation Events

The following table lists the UI Automation events required to be supported by all scroll bar controls. For more information on events, see Visão geral sobre eventos de automação de interface do usuário.

UI Automation Event

Support/Value

Notes

BoundingRectangleProperty property-changed event.

Required

None

IsOffscreenProperty property-changed event.

Required

None

IsEnabledProperty property-changed event.

Required

None

HorizontallyScrollableProperty property-changed event.

Never

None

HorizontalScrollPercentProperty property-changed event.

Never

None

HorizontalViewSizeProperty property-changed event.

Never

None

VerticalScrollPercentProperty property-changed event.

Never

None

VerticallyScrollableProperty property-changed event.

Never

None

VerticalViewSizeProperty property-changed event.

Never

None

ValueProperty property-changed event.

Depends

None

AutomationFocusChangedEvent

Required

None

StructureChangedEvent

Required

None

Consulte também

Referência

ScrollBar

Conceitos

Visão Geral dos Tipos de Controle de Automação de Interface do Usuário

UI Automation Overview