EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

Text Control Type

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

A text control is a basic user interface item that represents a piece of text on the screen.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the Text control type. The UI Automation requirements apply to all tree controls where the UI framework/platform integrates UI Automation support for control types and control patterns.

This topic contains the following sections.

Typical Tree Structure

The following table depicts a typical control and content view of the UI Automation tree that pertains to text controls and describes what can be contained in each view. For more information about the UI Automation tree, see UI Automation Tree Overview.

Control ViewContent View
  • Text
  • Text (if content)

 

A text control can be used alone as a label or as static text on a form. It can also be contained within the structure of one of the following items:

Text controls might not appear in the content view of the UI Automation tree because text is often displayed through the Name property of another control. For example, the text used to label a combo box control is exposed through the control's Name property. Because the combo box control is in the content view of the UI Automation tree, the text control need not be there. Text controls may have children in the content view if there is an embedded object such as a hyperlink.

Relevant Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to the text controls. For more information about UI Automation properties, see Retrieving Properties from UI Automation Elements.

UI Automation PropertyValueNotes
UIA_AutomationIdPropertyIdSee notes.The value of this property must be unique among all peer elements in the raw view of the UI Automation tree.
UIA_BoundingRectanglePropertyIdSee notes.The outermost rectangle that contains the whole control.
UIA_ClickablePointPropertyIdSee notes.Supported if there is a bounding rectangle. If not every point within the bounding rectangle is clickable, and the element performs specialized hit testing, override and provide a clickable point.
UIA_ControlTypePropertyIdText
UIA_IsContentElementPropertyIdDependsThe text control is content if it contains information not exposed in another control's Name property.
UIA_IsControlElementPropertyIdTRUEThe text control must always be a control.
UIA_IsKeyboardFocusablePropertyIdSee notes.If the control can receive keyboard focus, it must support this property.
UIA_LabeledByPropertyIdNULLText controls do not have a static text label.
UIA_LocalizedControlTypePropertyIdSee notes.Localized string corresponding to the Text control type. The default value is "text" for en-US or English (United States).
UIA_NamePropertyIdSee notes.The name of a text control can be the text that it displays. However, if the control also supports the Text pattern, and the text is extensive, don't use the full text content as the Name value. Instead, provide a Name value that is shorter, derived from other properties of your control.

 

Required Control Patterns

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

Control PatternSupportNotes
IGridItemProvider DependsIf the text control is contained within a table control, the GridItem control pattern must be supported.
ITableItemProvider DependsIf the text control is contained within a table control, the TableItem control pattern must be supported.
ITextProvider DependsText should support the Text control pattern for better accessibility; however, it is not required. The Text control pattern is useful when the text has rich style and attributes (for example, color, bold, and italics).
IValueProvider NeverA text control never supports the Value control pattern. If the text is editable, it is the Edit control type.

 

Required Events

The following table lists the UI Automation events that text controls are required to support. For more information on events, see UI Automation Events Overview.

UI Automation EventNotes
UIA_AutomationFocusChangedEventId
UIA_BoundingRectanglePropertyId property-changed 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_NamePropertyId property-changed event.
UIA_StructureChangedEventId
UIA_Text_TextChangedEventIdIf the control supports the Text control pattern, it must support this event.

 

Related topics

Conceptual
UI Automation Control Types Overview
UI Automation Overview

 

 

Community-Beiträge

Anzeigen:
© 2014 Microsoft