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

The List control type provides a way to organize a flat group or groups of items and allows a user to select one or more of those items. The List control type has a loose restriction on what types of child elements it may contain. This enables UI Automation providers to support a well-known element for selection containers.

The UI Automation requirements in the following sections apply to all controls that implement the List control type, whether Windows Presentation Foundation (WPF), Win32, or Windows Forms. List container controls are an example of controls that implement the List control type.

The following table depicts the two views of the UI Automation tree that pertain to list controls and describes what can be contained in each view. The control view contains only elements that are controls, and the content view removes redundant information from the tree. For example, a text control used to label a combo box will be exposed as the ComboBox NameProperty. Because the text control is already exposed in this manner through the control view it is unnecessary to have it exposed twice; therefore it is removed from the content view. For more information on the UI Automation tree, see UI Automation Tree Overview.

Control ViewContent View
Contains the elements that correspond to controls.Removes redundant information from the tree so that assistive technologies work with the smallest set of meaningful information to the end user.
List

- DataItem (0 or more)
- ListItem (0 or more)
- Group (0 or more)
- ScrollBar (0, 1 or 2)
List

- DataItem (0 or more)
- ListItem (0 or more)
- Group (0 or more)

The control view for a control that implements the List control type (such as a list control) consists of:

  • Zero or more items within the list control (items can be based on the List Item or Data Item control types)

  • Zero or more group controls within a list control

  • Zero, one, or two scroll bar controls

The content view of a control that implements the List control type (such as a list control) consists of:

  • Zero or more items within the list control (items can be based on the List Item or Data Item control types)

  • Zero or more groups within the list control

A list control must not have items that have a hierarchical relationship other than being grouped together. If the items have children in the UI Automation tree, then the list container should be based on the Tree control type.

The selectable items within the list control will be available from the descendants in the UI Automation tree of the list control. All items within the list control must belong to the same selection group. The selectable items in the list should be exposed as ListItem (instead of DataItem) control types.

The following table lists the UI Automation properties whose value or definition is especially relevant to list controls. 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.
ClickablePointPropertySee notes.If the list control has a clickable point (a point that can be clicked to cause the list to take focus), then that point must be exposed through this property.

If the value of the IsOffScreen property is true, then the NoClickablePointExceptionwill be raised.
IsKeyboardFocusablePropertySee notes.If the control can receive keyboard focus, it must support this property.
NamePropertySee notes.The value of a list control's Name property should convey the category of options that the user is being asked to select from. This property typically gets its name from a static text label. If there is not a static text label the application developer must expose a value for the Name property.

The only time this property is not required for list controls is if the control is used within the subtree of another control.
LabeledByPropertySee notes.If there is a static text label then this property must expose a reference to that control.
ControlTypePropertyListThis value is the same for all UI frameworks.
LocalizedControlTypeProperty"list"Localized string corresponding to the List control type.
IsContentElementPropertyTrueThe list control is always included in the content view of the UI Automation tree.
IsControlElementPropertyTrueThe list control is always included in the control view of the UI Automation tree.
IsKeyboardFocusablePropertyTrueIf the container can accept keyboard input then this property value should be true.
HelpTextPropertySee notes.The Help text for list controls should explain why the user is being asked to make a choice from a list of options. For example, "Selection an item from this list will set the display resolution for your monitor."

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

Control Pattern/Pattern PropertySupport/ValueNotes
ISelectionProviderRequiredAll controls that support the List control type must implement ISelectionProvider when a selection state is maintained between the items contained in the control. If the items within the container are not selectable, the Group control type must be used.
IsSelectionRequiredDependsList controls do not always require that an item be selected.
CanSelectMultipleDependsList controls can be single or multiple-selection containers.
IScrollProviderDependsImplement this control pattern if items in the container are scrollable.
IGridProviderDependsImplement this pattern when grid navigation needs to be available on an item by item basis.
IMultipleViewProviderDependsImplement this control pattern if the control can support multiple views of the items in the container.
ITableProviderNeverITableProvider is never supported for the List control type. If the control should support this control pattern, then the control should be based on the Data Grid control type.

The following table lists the UI Automation events required to be supported by all list controls. For more information on events, see UI Automation Events Overview.

UI Automation EventSupport/ValueNotes
InvalidatedEventDependsNone
LayoutInvalidatedEventDependsNone
BoundingRectangleProperty property-changed event.RequiredNone
IsOffscreenProperty property-changed event.RequiredNone
IsEnabledProperty property-changed event.RequiredNone
CurrentViewProperty property-changed event.DependsNone
HorizontallyScrollableProperty property-changed event.DependsNone
HorizontalScrollPercentProperty property-changed event.DependsNone
HorizontalViewSizeProperty property-changed event.DependsNone
VerticalScrollPercentProperty property-changed event.DependsNone
VerticallyScrollableProperty property-changed event.DependsNone
VerticalViewSizeProperty property-changed event.DependsNone
AutomationFocusChangedEventRequiredNone
StructureChangedEventRequiredNone

List
UI Automation Control Types Overview
UI Automation Overview

Show: