ITextProvider.RangeFromPoint(Point) 方法

定義

傳回最接近指定之螢幕座標的變質 (空) 文字範圍。Returns the degenerate (empty) text range nearest to the specified screen coordinates.

public:
 System::Windows::Automation::Provider::ITextRangeProvider ^ RangeFromPoint(System::Windows::Point screenLocation);
public System.Windows.Automation.Provider.ITextRangeProvider RangeFromPoint (System.Windows.Point screenLocation);
abstract member RangeFromPoint : System.Windows.Point -> System.Windows.Automation.Provider.ITextRangeProvider
Public Function RangeFromPoint (screenLocation As Point) As ITextRangeProvider

參數

screenLocation
Point

螢幕座標中的位置。The location in screen coordinates.

傳回

ITextRangeProvider

最接近指定位置的變質範圍。A degenerate range nearest the specified location. 從未傳回 Null 參考 (在 Visual Basic 中為 Nothing)。A null reference (Nothing in Visual Basic) is never returned.

例外狀況

如果指定的點位於與文字模式相關聯的消費者介面自動化元素之外。If a given point is outside the UI Automation element associated with the text pattern.

備註

如果螢幕座標位於影像、超連結或其他内嵌物件的座標內,則會傳回括住子物件的文字範圍。A text range that encloses a child object is returned if the screen coordinates are within the coordinates of an image, hyperlink, or other embedded object.

因為 RangeFromPoint 從最接近指定點的可見文字傳回的範圍中,不會忽略隱藏文字。Because hidden text is not ignored by RangeFromPoint a degenerate range from the visible text closest to the given point is returned.

適用於

另請參閱