ITextProvider.RangeFromChild Method (IRawElementProviderSimple)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Retrieves a text range enclosing a child element such as an image, hyperlink, or other embedded object.

Namespace:   System.Windows.Automation.Provider
Assembly:  UIAutomationProvider (in UIAutomationProvider.dll)

ITextRangeProvider RangeFromChild(
	IRawElementProviderSimple childElement


Type: System.Windows.Automation.Provider.IRawElementProviderSimple

The enclosed object.

Return Value

Type: System.Windows.Automation.Provider.ITextRangeProvider

A range that spans the child element.

Exception Condition

If the child element is a null reference (Nothing in Microsoft Visual Basic .NET).

A UI Automation provider should check that the passed element is a child of the text container.

If there is no text in the range where the child element exists, a degenerate (empty) range is returned.

The childElement parameter is either a child of the AutomationElement associated with a TextPattern or from the array of children of a TextPatternRange.

.NET Framework
Available since 3.0
Available since 4.0
Windows Phone Silverlight
Available since 7.1
Return to top