UI Automation Support for the ListItem 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 ListItem 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.

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 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 list item 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
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 TreeItem Control Type control type.

The following table lists the UI Automation properties whose value or definition is especially relevant to list item 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.This value of this property should include the area of the image and text contents of the list item.
ClickablePointPropertyDependsIf 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 list control is completely covered by descendant list items it will raise a NoClickablePointException to indicate that the client must ask an item inside the list control for a clickable point.
NamePropertySee notes.The value of a list item control's name property comes from the text contents of the item.
LabeledByPropertySee notes.If there is a static text label then this property must expose a reference to that control.
ControlTypePropertyListItemThis value is the same for all UI frameworks.
LocalizedControlTypeProperty"list item"Localized string corresponding to the ListItem 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.
HelpTextProperty""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."
ItemTypePropertyDependsThis 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.
IsOffscreenPropertyDependsThis property must return a value for whether the list item is currently scrolled into view within the parent container that implements Scroll control pattern.

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

Control PatternSupportNotes
ISelectionItemProviderYesList item control must implement this control pattern. This allows list items controls to convey when they are selected.
IScrollItemProviderDependsIf the list item is contained within a container that is scrollable then this control pattern must be implemented.
IToggleProviderDependsIf the list item is checkable and the action does not perform a selection state change then this control pattern must be implemented.
IExpandCollapseProviderDependsIf the item can be manipulated to show or hide information then this control pattern must be implemented.
IValueProviderDependsIf the item can be edited then this control pattern must be implemented. Changes to the list item control will cause changes to the values of NameProperty, and Value.
IGridItemProviderDependsIf 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.
IInvokeProviderDependsIf the item has a command that can be performed on it, separate from selection, then 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.

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

UI Automation EventSupportNotes
InvokedEventDependsNone
ElementAddedToSelectionEventRequiredNone
ElementRemovedFromSelectionEventRequiredNone
ElementSelectedEventRequiredNone
BoundingRectangleProperty property-changed event.RequiredNone
IsOffscreenProperty property-changed event.RequiredNone
IsEnabledProperty property-changed event.RequiredNone
NamePropertyRequiredNone
ItemStatusProperty property-changed event.DependsNone
ExpandCollapseStateProperty property-changed event.DependsNone
ValueProperty property-changed event.DependsNone
ToggleStateProperty property-changed event.DependsNone
AutomationFocusChangedEventRequiredNone
StructureChangedEventRequiredNone

ListItem
UI Automation Control Types Overview
UI Automation Overview

Show: