Export (0) Print
Expand All

UI Automation Support for the Tree Control Type

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

The Tree control type is used for containers whose contents have relevance as a hierarchy of nodes, as with the way files and folders are displayed in the left pane of Windows Explorer. Each node has the potential to contain other nodes, called child nodes. Parent nodes, or nodes that contain child nodes, can be displayed as expanded or collapsed.

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

This topic contains the following sections.

Required UI Automation Tree Structure

The following table depicts the two views of the UI Automation tree that pertain to tree 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
  • Tree
    • DataItem (0 or more)
    • TreeItem (0 or more)
      • TreeItem (0 or more)
        • ...
    • ScrollBar (0, 1, 2)
  • Tree
    • DataItem (0 or more)
    • TreeItem (0 or more)
      • TreeItem (0 or more)
        • ...

The control view of the UI Automation tree consists of:

  • Zero of many items within the container (items can be based on the Tree Item or Data Item control types).
  • Zero, one, or two scroll bar controls

The content view of the UI Automation tree consists of zero or many items within the container (items can be based on the Tree Item or Data Item control types).

Required UI Automation Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to the Tree control type. 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 See notes. Tree controls have a clickable point that cause the tree or one the items in the tree container to receive the focus. A tree can have a clickable point only if it is possible to click a location in the tree without causing an item to be selected or to receive the focus.
UIA_ControlTypePropertyId Tree This value is the same for all UI frameworks.
UIA_IsContentElementPropertyId TRUE The tree control is always included in the content view of the UI Automation tree.
UIA_IsControlElementPropertyId TRUE The tree control is always included in the control view of the UI Automation tree.
UIA_IsKeyboardFocusablePropertyId See notes. If the control can receive keyboard focus, it must support this property.
UIA_LabeledByPropertyId See notes. If the tree control has a label associated with it, this property returns a IUIAutomationElement pointer for that label. Otherwise, the property returns a null reference.
UIA_LocalizedControlTypePropertyId See notes. Localized string corresponding to the Tree control type. The default value is "tree" for en-US or English (United States).
UIA_NamePropertyId See notes. The value of a tree control's name property usually comes from text that labels the control. If there is no text label, you must provide a value for this property.

Required UI Automation Control Patterns

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

Control Pattern/Pattern Property Support/Value Notes
IScrollProvider Depends Implement this control pattern if items in the tree container can be scrolled.
ISelectionProvider Depends Tree controls that contain a set of selectable items must implement this control pattern. It need not be implemented if selecting an item conveys no meaningful information to the user.
ISelectionProvider::CanSelectMultiple See notes. Implement this property if the tree control supports multiple selection (most tree controls do not support multiple selection).
ISelectionProvider::IsSelectionRequired See notes. The value of this property is exposed if the control requires that an item be selected.

Required UI Automation Events

The following table lists the UI Automation events that all tree controls must 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_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_ScrollVerticalScrollPercentPropertyId 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_ScrollVerticalViewSizePropertyId property-changed event. If the control supports the Scroll control pattern, it must support this event.
UIA_Selection_InvalidatedEventId If the control supports the Scroll control pattern, it must support this event.
UIA_StructureChangedEventId None

Related Topics

Community Additions

Show:
© 2014 Microsoft