UI Automation Support for the Tab 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 Tab 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 UI Automation. control patterns.

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 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 pertains to tab controls and describes what can be contained in each view. For more information on the UI Automation tree, see UI Automation Tree Overview.

Control ViewContent 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 ViewContent View
Tab

 
  • TabItem (1 or more)
  • Group (0 or more)

     
    • TabItem (0 or more)
  • ScrollBar (0 or more)

     
    • Button (0 or 2)
Tab

 
  • TabItem (1 or more)
  • Group (0 or more)

     
    • TabItem (0 or more)

The following table lists the UI Automation properties whose value or definition is especially relevant to the Tab control type. 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.
IsKeyboardFocusablePropertySee notes.If the control can receive keyboard focus, it must support this property.
NamePropertySee notes.The tab control rarely requires a Name property.
ClickablePointPropertyNoThe tab control does not have a clickable point.
LabeledByPropertySee notes.Tab controls typically have a static text label that is exposed through this property.
ControlTypePropertyTabThis value is the same for all UI frameworks.
LocalizedControlTypeProperty"tab"Localized string corresponding to the Tab control type.
IsKeyboardFocusablePropertyTrueThe Tab control type must be able to receive keyboard focus. Typically, a UI Automation client calls 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.
IsContentElementPropertyTrueThe tab control is always included in the content view of the UI Automation tree.
IsControlElementPropertyTrueThe tab control is always included in the control view of the UI Automation tree.
OrientationPropertySee notes.The tab control must always indicate whether it is positioned horizontally or vertically.

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 PropertySupport/ValueNotes
ISelectionProviderYesAll tab controls must support the Selection pattern.
IsSelectionRequiredTrueTab controls always require that a selection be made.
CanSelectMultipleFalseTab controls are always single-selection containers.
IScrollProviderDependsThe Scroll pattern must be supported in the tab control has widgets that allow for a set of tab items to be scrolled through.

The following table lists the UI Automation events required to be supported by all tab 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
HorizontallyScrollableProperty property-changed event.DependsNone
HorizontalScrollPercentProperty property-changed event.DependsNone
HorizontallyScrollableProperty property-changed event.DependsNone
HorizontalViewSizeProperty property-changed event.DependsNone
VerticalScrollPercentProperty property-changed event.DependsNone
VerticalViewSizeProperty property-changed event.DependsNone
AutomationFocusChangedEventRequiredNone
StructureChangedEventRequiredNone

Tab
UI Automation Control Types Overview
UI Automation Overview

Show: