UIElement.InputHitTest(Point) 方法

定義

在目前項目範圍中傳回的輸入項目,輸入項目位在相對於目前項目原點的指定座標。Returns the input element within the current element that is at the specified coordinates, relative to the current element's origin.

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

這個項目內的位移 (Offset) 座標。The offset coordinates within this element.

傳回

IInputElement

位在指定位置的項目子系。The element child that is located at the given position.

備註

IInputElement 會傳回做為傳回型別,因為該型別是和的通用 UIElement 介面 ContentElementIInputElement is returned as the return type, because that type is a common interface for both UIElement and ContentElement. 然後,您可以適當地轉換傳回型別,或針對介面所定義的特定成員使用介面實例 IInputElementYou can then cast the return type appropriately, or use the interface instance for certain members that are defined by the IInputElement interface.

此方法通常不會從您的應用程式程式碼呼叫。This method typically is not called from your application code. 只有當您想要重新執行已存在的大量低層級輸入功能(例如重新建立滑鼠裝置邏輯)時,才適合呼叫這個方法。Calling this method is only appropriate if you intend to re-implement a substantial amount of the low level input features that are already present, such as recreating mouse device logic.

IContentHostInputHitTest使用相同的簽章來建立方法的合約,而某些元素會選擇明確地執行。IContentHost contracts an InputHitTest method with the same signature, which some elements choose to implement explicitly.

適用於