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 members Member type Notes
TextContainer Property None
TextRange Property None

 

This control pattern has no associated methods or events.

Conceptual