Share via


TextPattern.RangeFromPoint(Point) メソッド

定義

指定した画面座標の最も近くにある低次元 (空の) テキスト範囲を返します。

public:
 System::Windows::Automation::Text::TextPatternRange ^ RangeFromPoint(System::Windows::Point screenLocation);
public System.Windows.Automation.Text.TextPatternRange RangeFromPoint (System.Windows.Point screenLocation);
member this.RangeFromPoint : System.Windows.Point -> System.Windows.Automation.Text.TextPatternRange
Public Function RangeFromPoint (screenLocation As Point) As TextPatternRange

パラメーター

screenLocation
Point

画面座標での位置。

戻り値

指定した位置の最も近くにある低次元テキスト範囲。 Null は返されません。

例外

指定した位置は、テキスト パターンに関連付けられている AutomationElement の外側にあります。

private TextPatternRange GetRangeFromPoint()
{
    return targetTextPattern.RangeFromPoint(
        _root.Current.BoundingRectangle.TopLeft);
}
Private Function GetRangeFromPoint() As TextPatternRange
    Return targetTextPattern.RangeFromPoint( _
    _root.Current.BoundingRectangle.TopLeft)
End Function

注釈

画面座標が画像、ハイパーリンク、Excel スプレッドシート、またはその他の埋め込みオブジェクトの座標内にある場合は、子オブジェクトをラップするテキスト範囲Microsoft返されます。

非表示のテキストは によって RangeFromPoint無視されないため、指定されたポイントに最も近い表示テキストから縮退範囲が返されます。

適用対象

こちらもご覧ください