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 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 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 TabItem control type. When tab items are grouped (for example, as in Microsoft Office 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)

 

Relevant 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 Retrieving Properties from UI Automation Elements.

UI Automation Property Value Notes
UIA_AutomationIdPropertyId See notes. The value of this property must be unique among all peer elements in the raw view of the UI Automation tree.
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
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 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 Required All tab controls must support the Selection control pattern.
IsSelectionRequired TRUE Tab controls always require that a selection be made.
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 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
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_ScrollHorizontallyScrollablePropertyId property-changed event. If the control supports the Scroll control pattern, it must support this event.
UIA_ScrollHorizontalScrollPercentPropertyId 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_ScrollVerticalScrollPercentPropertyId 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

 

Conceptual

UI Automation Control Types Overview

UI Automation Overview