Share via


UI Automation Support for the Tab Control Type

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

A tab control is analogous to the dividers in a notebook or the labels in a file cabinet. By using a tab control, an application can define multiple pages for the same area of a window or dialog box.

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

This topic contains the following sections.

  • Required UI Automation Tree Structure
  • Required UI Automation Properties
  • Required UI Automation Control Patterns
  • Required UI Automation Events
  • Related Topics

Required UI Automation Tree Structure

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

Control View Content View
  • Tab
    • TabItem (1 or more)
    • ScrollBar (0 or 1)
      • Button (0 or 2)
  • Tab
    • TabItem (1 or more)

Tab controls have child UI Automation elements based on the Tab Item control type. When tab items are grouped (for example, as in Microsoft Office 2007 applications) the Tab control type can also host Groups control types for the grouped tab items, as the following tree structure shows.

Control View Content View
  • Tab
    • TabItem (1 or more)
    • Group (0 or more)
      • TabItem (0 or more)
    • ScrollBar (0 or 1)
      • Button (0 or 2)
  • Tab
    • TabItem (1 or more)
    • Group (0 or more)
      • TabItem (0 or more)

Required UI Automation Properties

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

UI Automation Property Value Notes
UIA_AutomationIdPropertyId See notes. The value of this property needs to be unique across all controls in an application.
UIA_BoundingRectanglePropertyId See notes. The outermost rectangle that contains the whole control.
UIA_ClickablePointPropertyId No The tab control does not have clickable points.
UIA_ControlTypePropertyId Tab This value is the same for all UI frameworks.
UIA_IsContentElementPropertyId TRUE The tab control is always included in the content view of the UI Automation tree.
UIA_IsControlElementPropertyId TRUE The tab control is always included in the control view of the UI Automation tree.
UIA_IsKeyboardFocusablePropertyId TRUE The Tab control type must be able to receive keyboard focus. Typically, a UI Automation client calls IUIAutomationElement::SetFocus on a tab control and one of its items will forward the keyboard focus to the tab control. It is possible for some tab containers to take focus without setting focus to one of its items.
UIA_LabeledByPropertyId See notes. Tab controls typically have a static text label that is exposed through this property.
UIA_LocalizedControlTypePropertyId See notes. Localized string corresponding to the Tab control type. The default value is "tab" for en-US or English (United States).
UIA_NamePropertyId See notes. The tab control rarely requires a Name property.
UIA_OrientationPropertyId See notes. The tab control must always indicate whether it is positioned horizontally or vertically.

Required UI Automation Control Patterns

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

Control Pattern/Pattern Property Support/Value Notes
ISelectionProvider Yes All tab controls must support the Selection control pattern.
ISelectionProvider::IsSelectionRequired TRUE Tab controls always require that a selection be made.
ISelectionProvider::CanSelectMultiple FALSE Tab controls are always single-selection containers.
IScrollProvider Depends The Scroll control pattern must be supported if the tab control has widgets that allow for a set of tab items to be scrolled through.

Required UI Automation Events

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

UI Automation Event Notes
UIA_AutomationFocusChangedEventId None
UIA_BoundingRectanglePropertyId property-changed event. None
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_ScrollHorizontallyScrollablePropertyId property-changed event. If the control supports the Scroll control pattern, it must support this event.
UIA_ScrollHorizontalScrollPercentId property-changed event. If the control supports the Scroll control pattern, it must support this event.
UIA_ScrollHorizontalViewSizePropertyId property-changed event. If the control supports the Scroll control pattern, it must support this event.
UIA_ScrollVerticallyScrollablePropertyId property-changed event. If the control supports the Scroll control pattern, it must support this event.
UIA_ScrollVerticalScrollPercentId property-changed event. If the control supports the Scroll control pattern, it must support this event.
UIA_ScrollVerticalViewSizePropertyId property-changed event. If the control supports the Scroll control pattern, it must support this event.
UIA_StructureChangedEventId None