TextPattern::RangeFromPoint Method (Point)


Returns the degenerate (empty) text range nearest to the specified screen coordinates.

Namespace:   System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

TextPatternRange^ RangeFromPoint(
	Point screenLocation


Type: System.Windows::Point

The location in screen coordinates.

Return Value

Type: System.Windows.Automation.Text::TextPatternRange^

A degenerate range nearest the specified location. Null is never returned.

Exception Condition

A given point is outside the AutomationElement associated with the text pattern.

A text range that wraps a child object is returned if the screen coordinates are within the coordinates of an image, hyperlink, Microsoft Excel spreadsheet, or other embedded object.

Because hidden text is not ignored by RangeFromPoint, a degenerate range from the visible text closest to the given point is returned.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 3.0
Return to top