UI Automation Properties Overview

 
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.

UI Automation providers expose properties on Microsoft UI Automation elements. These properties enable UI Automation client applications to discover information about pieces of the user interface (UI), especially controls, including both static and dynamic data.

This section gives a broad overview of Microsoft UI Automation properties. More specific information is given in the following topics:

Every property is identified by a number and a name. The names of properties are used only for debugging and diagnosis. Providers use the numeric IDs to identify incoming property requests. Client applications, however, only use AutomationProperty, which encapsulates the number and name, to identify properties they wish to retrieve.

AutomationProperty objects representing particular properties are available as fields in various classes. For security reasons, UI Automation providers obtain these objects from a separate set of classes that are contained in Uiautomationtypes.dll.

The following table categorizes properties by the classes that contain the AutomationPropertyIDs.

Kinds of propertiesClients get IDs fromProviders get IDs from
Properties common to all elements (see following tables)AutomationElementAutomationElementIdentifiers
Position of a docking windowDockPatternDockPatternIdentifiers
State of an element that can expand and collapseExpandCollapsePatternExpandCollapsePatternIdentifiers
Properties of an item in a gridGridItemPatternGridItemPatternIdentifiers
Properties of a gridGridPatternGridPatternIdentifiers
Current and supported view of an element that has multiple viewsMultipleViewPatternMultipleViewPatternIdentifiers
Properties of an element that moves over a range of values, such as a sliderRangeValuePatternRangeValuePatternIdentifiers
Properties of a scrolling windowScrollPatternScrollPatternIdentifiers
Status and container of an item that can be selected, as in a listSelectionItemPatternSelectionItemPatternIdentifiers
Properties of a control that contains selection itemsSelectionPatternSelectionPatternIdentifiers
Column and row headers of an item in a tableTableItemPatternTableItemPatternIdentifiers
Column and row headers, and orientation, of a tableTablePatternTablePatternIdentifiers
State of a toggle controlTogglePatternTogglePatternIdentifiers
Capabilities of an element that can be moved, rotated, or resizedTransformPatternTransformPatternIdentifiers
Value and read/write capabilities of an element that has a valueValuePatternValuePatternIdentifiers
Capabilities and state of a windowWindowPatternWindowPatternIdentifiers

The following tables categorize the properties whose IDs are found in AutomationElement and AutomationElementIdentifiers. These properties are common to all controls. All but a few of them are likely to be static over the lifetime of the provider application; most dynamic properties are associated with control patterns.

The Property Access column lists any other accessors for each property, in addition to GetCurrentPropertyValue and GetCachedPropertyValue. For more information on getting properties in a client application, see UI Automation Properties for Clients.

System_CAPS_ICON_note.jpg Note

For specific information about each property, follow the link in the Property Access column.

Display Characteristics

Property identifierProperty access
BoundingRectanglePropertyBoundingRectangle
CulturePropertyn/a
HelpTextPropertyHelpText
IsOffscreenPropertyIsOffscreen
OrientationPropertyOrientation

Element Type

Property identifierProperty access
ControlTypePropertyControlType
IsContentElementPropertyIsContentElement
IsControlElementPropertyIsControlElement
ItemTypePropertyItemType
LocalizedControlTypePropertyLocalizedControlType

Identification

Property identifierProperty access
AutomationIdPropertyAutomationId
ClassNamePropertyClassName
FrameworkIdPropertyFrameworkId
LabeledByPropertyLabeledBy
NamePropertyName
ProcessIdPropertyProcessId
RuntimeIdPropertyGetRuntimeId
NativeWindowHandlePropertyNativeWindowHandle

Interaction

Property identifierProperty access
AcceleratorKeyPropertyAcceleratorKey
AccessKeyPropertyAccessKey
ClickablePointPropertyGetClickablePoint
HasKeyboardFocusPropertyHasKeyboardFocus
IsEnabledPropertyIsEnabled
IsKeyboardFocusablePropertyIsKeyboardFocusable

Support for Patterns

Property identifierProperty access
IsDockPatternAvailablePropertyGetSupportedPatterns
IsExpandCollapsePatternAvailablePropertyGetSupportedPatterns
IsGridItemPatternAvailablePropertyGetSupportedPatterns
IsGridPatternAvailablePropertyGetSupportedPatterns
IsInvokePatternAvailablePropertyGetSupportedPatterns
IsMultipleViewPatternAvailablePropertyGetSupportedPatterns
IsRangeValuePatternAvailablePropertyGetSupportedPatterns
IsScrollItemPatternAvailablePropertyGetSupportedPatterns
IsScrollPatternAvailablePropertyGetSupportedPatterns
IsSelectionItemPatternAvailablePropertyGetSupportedPatterns
IsSelectionPatternAvailablePropertyGetSupportedPatterns
IsTableItemPatternAvailablePropertyGetSupportedPatterns
IsTablePatternAvailablePropertyGetSupportedPatterns
IsTextPatternAvailablePropertyGetSupportedPatterns
IsTogglePatternAvailablePropertyGetSupportedPatterns
IsTransformPatternAvailablePropertyGetSupportedPatterns
IsValuePatternAvailablePropertyGetSupportedPatterns
IsWindowPatternAvailablePropertyGetSupportedPatterns

Miscellaneous

Property identifierProperty access
IsRequiredForFormPropertyIsRequiredForForm
IsPasswordPropertyIsPassword
ItemStatusPropertyItemStatus

UI Automation providers should present the following properties in the language of the operating system:

Closely tied in with the properties in UI Automation is the concept of property-changed events. For dynamic properties, the client application needs a way to know that a property value has changed, so that it can update its cache of information or react to the new information in some other way.

Providers raise events when something in the UI changes. For example, if a check box is selected or cleared, a property-changed event is raised by the provider's implementation of the Toggle pattern. Providers can raise events selectively, depending on whether any clients are listening for events, or listening for specific events.

Not all property changes raise events; that is entirely up to the implementation of the UI Automation provider for the element. For example, the standard proxy providers for list boxes do not raise an event when the SelectionProperty changes. In this case, the application instead must listen for an ElementSelectedEvent.

Clients listen for events by subscribing to them. Subscribing to events means creating delegate methods that can handle the events, and then passing the methods to UI Automation along with the specific events that will be dealt with in those methods. For property-changed events in particular, clients must implement AutomationPropertyChangedEventHandler.

Caching in UI Automation Clients
UI Automation Properties for Clients
Server-Side UI Automation Provider Implementation
Find a UI Automation Element Based on a Property Condition
Return Properties from a UI Automation Provider
Raise Events from a UI Automation Provider

Show: