語言

UIElement.InputHitTest(Point) 方法

定義

回傳目前元素中相對於該元素原點位於指定座標的輸入元素。

public:
 System::Windows::IInputElement ^ InputHitTest(System::Windows::Point point);
public System.Windows.IInputElement InputHitTest(System.Windows.Point point);
member this.InputHitTest : System.Windows.Point -> System.Windows.IInputElement
Public Function InputHitTest (point As Point) As IInputElement

參數

point
Point

此元素內的偏移座標。

傳回

位於指定位置的元素子節點。

備註

IInputElement作為回傳型別回傳,因為該型別是 和 UIElement的共用介面ContentElement。 接著你可以適當地投射回傳型別,或使用介面實例來處理介面中定義 IInputElement 的特定成員。

此方法通常不會從你的應用程式代碼中呼叫。 只有當你打算重新實作大量已存在的低階輸入功能時,才會呼叫此方法,例如重現滑鼠裝置邏輯。

IContentHost 締約一個 InputHitTest 具有相同簽名的方法,部分元素選擇明確實作。

適用於