Share via


UI Automation Support for the ListItem Control Type

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

List item controls are an example of controls that implement the ListItem control type.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the ListItem control type. The UI Automation requirements apply to all list item 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
  • Remarks
  • 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 list item 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
  • ListItem
    • Image (0 or more)
    • Text (0 or more)
    • Edit (0 or more)
  • ListItem

The children of a list item control within the content view of the UI Automation tree must always be "0". If the structure of the control is such that other items are contained underneath the list item then it should follow the requirements for the UI Automation Support for the Tree Item control type.

Required UI Automation Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to the ListItem 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. This value of this property should include the area of the image and text contents of the list item.
UIA_ClickablePointPropertyId Depends If the list control has a clickable point (a point that can be clicked to cause the list to take focus), that point must be exposed through this property. If the list control is completely covered by descendant list items, it will return the UIA_E_NOCLICKABLEPOINT error to indicate that the client must ask an item inside the list control for a clickable point.
UIA_ControlTypePropertyId ListItem This value is the same for all user interface (UI) frameworks.
UIA_HelpTextPropertyId "" The Help text for list controls should explain why the user is being asked to make a choice from a list of options, which is typically the same type of information presented through a tooltip. For example, "Select an item to set the display resolution for your monitor."
UIA_IsContentElementPropertyId TRUE The list control is always included in the content view of the UI Automation tree.
UIA_IsControlElementPropertyId TRUE The list control is always included in the control view of the UI Automation tree.
UIA_IsKeyboardFocusablePropertyId TRUE If the container can accept keyboard input then this property value should be true.
UIA_IsOffscreenPropertyId Depends This property must return a value for whether the list item is currently scrolled into view within the parent container that implements Scroll control pattern.
UIA_ItemStatusPropertyId See notes. If the control contains status that is being updated dynamically, this property must be supported so that an assistive technology can receive updates when the status of the element changes.
UIA_ItemTypePropertyId Depends This property should be exposed for list item controls that are representing an underlying object. These list item controls typically have an icon associated with the control that users associate with the underlying object.
UIA_LabeledByPropertyId See notes. If there is a static text label then this property must expose a reference to that control.
UIA_LocalizedControlTypePropertyId See notes. Localized string corresponding to the ListItem control type. The default value is "list item" for en-US or English (United States).
UIA_NamePropertyId See notes. The value of a list item control's name property comes from the text contents of the item.

Required UI Automation Control Patterns

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

Control Pattern/Pattern Property Support/Value Notes
IExpandCollapseProvider Depends If the item can be manipulated to show or hide information then this control pattern must be implemented.
IGridItemProvider Depends If item to item spatial navigation is supported within the list container and the container is arranged in rows and columns then the Grid Item control pattern must be implemented.
IInvokeProvider Depends If the item has a command that can be performed on it, separate from selection, this pattern must be implemented. This is typically an action associated with double-clicking the list item control. Examples would be launching a document from Microsoft Windows Explorer, or playing a music file in Microsoft Windows Media Player.
IScrollItemProvider Depends If the list item is contained within a container that is scrollable then this control pattern must be implemented.
ISelectionItemProvider Yes List item control must implement this control pattern. This allows list items controls to convey when they are selected.
IToggleProvider Depends If the list item is checkable and the action does not perform a selection state change then this control pattern must be implemented.
IValueProvider Depends If the item can be edited, this control pattern must be implemented. Changes to the list item control will cause changes to the values of the UIA_NamePropertyId and UIA_ValueValuePropertyId properties.

Required UI Automation Events

The following table lists the UI Automation events that list item 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_ExpandCollapseExpandCollapseStatePropertyId property-changed event. If the control supports the ExpandCollapse control pattern, it must support this event.
UIA_Invoke_InvokedEventId If the control supports the Invoke control pattern, it must support this 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_ItemStatusPropertyId If the control supports the ItemStatus property, is must support this event.
UIA_NamePropertyId property-changed event. None
UIA_SelectionItem_ElementAddedToSelectionEventId If the control supports the SelectionItem control pattern, it must support this event.
UIA_SelectionItem_ElementRemovedFromSelectionEventId If the control supports the SelectionItem control pattern, it must support this event.
UIA_SelectionItem_ElementSelectedEventId If the control supports the SelectionItem control pattern, it must support this event.
UIA_StructureChangedEventId None
UIA_ToggleToggleStatePropertyId property-changed event. If the control supports the Toggle control pattern, it must support this event.
UIA_ValueValuePropertyId property-changed event. If the control supports the Value control pattern, it must support this event.

Remarks

If a container hosts list items, the primary means of navigation should go to the list items. Placing the focus on subelements through list navigation can be confusing to users and accessibility tools. If the container hosts a vertical list of items, pressing the UP ARROW and DOWN ARROW keys should navigate through the items, but pressing the RIGHT ARROW and LEFT ARROW keys may navigate to subelements of the focused item, such as list columns or UI subelements.