TextChild Control Pattern

Introduces guidelines and conventions for implementing ITextChildProvider, including information about properties and methods. The TextChild control pattern is used to access an element’s nearest ancestor that supports the Text control pattern.

For example, suppose text in a document contains an embedded image and a hyperlink as shown in the following image.

Screen shot showing text containing an embedded image and a hyperlink

If you use Microsoft UI Automation tools to examine the UI Automation tree for this document content, it might show a document element with one child element that represents the image, and another child element that represents the hyperlink. For example:

Screen shot showing Inspect reporting a sample UI Automation element tree

Typically, the document element in the preceding example supports the Text control pattern, but the two children of the document element do not. If a UI Automation client application has a reference to the image element or hyperlink element, the client can use the TextChild control pattern as a convenient way to access the Textcontrol pattern exposed by the containing document element.

Implementation Guidelines and Conventions

When implementing the ITextChildProvider interface, note the following guidelines and conventions:

Required Members for ITextChildProvider

These properties and methods are required for implementing the ITextChildProvider interface.

Required membersMember typeNotes
TextContainer PropertyNone
TextRange PropertyNone

 

This control pattern has no associated methods or events.

Related topics

Conceptual
Control Types and Their Supported Control Patterns
UI Automation Control Patterns Overview
UI Automation Tree Overview

 

 

Community Additions

ADD
Show:
© 2014 Microsoft