Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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.

  Name Description
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(Visual, HitTestFilterCallback, HitTestResultCallback, HitTestParameters) Initiates a hit test on the specified Visual, with caller-defined HitTestFilterCallback and HitTestResultCallback methods.
Public method Static member HitTest(Visual3D, HitTestFilterCallback, HitTestResultCallback, HitTestParameters3D) Initiates a hit test on the specified Visual3D, 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.

Show:
© 2014 Microsoft