Compartir a través de


UI Automation Support for the Text Control Type

Actualización: noviembre 2007

This topic provides information about Automatización de la interfaz de usuario support for the Text control type. In Automatización de la interfaz de usuario, 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 Automatización de la interfaz de usuario tree structure, Automatización de la interfaz de usuario property values and control patterns.

Text controls are the basic user interface item that represents a piece of text on the screen.

The following sections define the required Automatización de la interfaz de usuario tree structure, properties, control patterns, and events for the Text control type. The Automatización de la interfaz de usuario requirements apply to all text controls, whether Windows Presentation Foundation (WPF), Win32, or formularios Windows Forms.

Este tema contiene las secciones siguientes.

  • Required UI Automation Tree Structure
  • Required UI Automation Properties
  • Required UI Automation Control Patterns
  • Required UI Automation Events
  • Temas relacionados

Required UI Automation Tree Structure

The following table depicts the control view and the content view of the Automatización de la interfaz de usuario tree that pertains to text controls and describes what can be contained in each view. For more information on the Automatización de la interfaz de usuario tree, see UI Automation Tree Overview.

Control View

Content 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 a:

  • ListItem

  • TreeItem

  • DataItem

Text controls may not be in the Content View of the Automatización de la interfaz de usuario tree because text is often displayed through the NameProperty of another control. For example the text that is used to label a Combo Box control is exposed through the control's NameProperty value. Because the Combo Box control is in the content view of the UI Automation Tree, it is not necessary for the text control to be there. Text controls always have 0 children in the content view

Required UI Automation Properties

The following table lists the Automatización de la interfaz de usuario properties whose value or definition is especially relevant to text controls. For more information on Automatización de la interfaz de usuario properties, see UI Automation Properties for Clients.

Automatización de la interfaz de usuario Property

Value

Notes

AutomationIdProperty()

See notes.

The value of this property needs to be unique across all controls in an application.

BoundingRectangleProperty

See notes.

The outermost rectangle that contains the whole control.

ClickablePointProperty

See notes.

Supported if there is a bounding rectangle. If not every point within the bounding rectangle is clickable, and you perform specialized hit testing, then override and provide a clickable point.

IsKeyboardFocusableProperty

See notes.

If the control can receive keyboard focus, it must support this property.

NameProperty

See notes.

The text bar control's name is always the txt that it displays.

LabeledByProperty

Null

Text controls do not have a static text label.

ControlTypeProperty

Text

This value is the same for all UI frameworks.

LocalizedControlTypeProperty

"text"

Localized string corresponding to the text control type.

IsContentElementProperty

Depends

The text control will be content if it contains information not exposed in another control's NameProperty.

IsControlElementProperty

True

The text control must always be a control.

Required UI Automation Control Patterns

The following table lists the Automatización de la interfaz de usuario control patterns required to be supported by text controls. For more information on control patterns, see Información general acerca de los patrones de control de automatización de la interfaz de usuario.

Control Pattern/Pattern Property

Support/Value

Notes

IValueProvider

Never

Text never supports ValuePattern. If the text is editable, this it is the Edit control type.

ITextProvider

Depends

Depends on framework.

ITableItemProvider

Depends

If the text element is contained within a Table control, this must be supported.

IRangeValueProvider

Depends

If the text element is contained within a table control, this must be supported.

Required UI Automation Events

The following table lists the Automatización de la interfaz de usuario events required to be supported by all text controls. For more information about events, see UI Automation Events Overview.

Automatización de la interfaz de usuario Event

Support

Notes

TextSelectionChangedEvent

Required

None

TextChangedEvent

Required

None

BoundingRectangleProperty property-changed event.

Required

None

IsOffscreenProperty property-changed event.

Required

None

IsEnabledProperty property-changed event.

Required

None

NameProperty property-changed event.

Required

None

ValueProperty property-changed event.

Never

None

AutomationFocusChangedEvent

Required

None

StructureChangedEvent

Required

None

Vea también

Conceptos

UI Automation Control Types Overview

UI Automation Overview

Referencia

Text