Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
InputHitTest Method
Collapse the table of content
Expand the table of content

UIElement.InputHitTest Method

Returns the input element within the current element that is at the specified coordinates, relative to the current element's origin.

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)

'Declaration
Public Function InputHitTest ( _
	point As Point _
) As IInputElement

Parameters

point
Type: System.Windows.Point

The offset coordinates within this element.

Return Value

Type: System.Windows.IInputElement
The element child that is located at the given position.

IInputElement is returned as the return type, because that type is a common interface for both UIElement and ContentElement. You 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.

IContentHost contracts an InputHitTest method with the same signature, which some elements choose to implement explicitly.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft