Implementing the UI Automation Value Control Pattern
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 introduces guidelines and conventions for implementing IValueProvider, including information on events and properties. Links to additional references are listed at the end of the topic.
The ValuePattern control pattern is used to support controls that have an intrinsic value not spanning a range and that can be represented as a string. This string can be editable, depending on the control and its settings. For examples of controls that implement this pattern, see Control Pattern Mapping for UI Automation Clients.
This topic contains the following sections.
When implementing the Value control pattern, note the following guidelines and conventions:
Controls such as ListItem and TreeItem must support ValuePattern if the value of any of the items is editable, regardless of the current edit mode of the control. The parent control must also support ValuePattern if the child items are editable.
Single-line edit controls support programmatic access to their contents by implementing IValueProvider. However, multi-line edit controls do not implement IValueProvider; instead they provide access to their content by implementing ITextProvider.
IValueProvider must be implemented by controls such as the Color Picker selection control from Microsoft Word (illustrated below), which supports string mapping between a color value (for example, "yellow") and an equivalent internal RGB structure.
Providers must throw the following exceptions.