VisualTreeHelper.HitTest Method

Returns the topmost Visual object of a hit test.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method Static member HitTest(Visual, Point) Returns the topmost Visual object of a hit test by specifying a Point.
Public method Static member HitTest(Visual3D, HitTestFilterCallback, HitTestResultCallback, HitTestParameters3D) Initiates a hit test on the specified Visual3D, with caller-defined HitTestFilterCallback and HitTestResultCallback methods.
Public method Static member HitTest(Visual, HitTestFilterCallback, HitTestResultCallback, HitTestParameters) Initiates a hit test on the specified Visual, with caller-defined HitTestFilterCallback and HitTestResultCallback methods.
Top

The overloaded methods that take HitTestResultCallback and HitTestFilterCallback as parameters provide additional functionality during hit testing:

  • Allow you to participate in controlling the visual tree traversal during hit testing.

  • Allow you to retrieve all of the visuals under the point or geometry, not just the topmost one.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft