Windows apps
Collapse the table of content
Expand the table of content
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

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns the topmost Visual object of a hit test.

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

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticHitTest(Visual, HitTestFilterCallback, HitTestResultCallback, HitTestParameters)

Initiates a hit test on the specified Visual, with caller-defined HitTestFilterCallback and HitTestResultCallback methods.

System_CAPS_pubmethodSystem_CAPS_staticHitTest(Visual, Point)

Returns the topmost Visual object of a hit test by specifying a Point.

System_CAPS_pubmethodSystem_CAPS_staticHitTest(Visual3D, HitTestFilterCallback, HitTestResultCallback, HitTestParameters3D)

Initiates a hit test on the specified Visual3D, with caller-defined HitTestFilterCallback and HitTestResultCallback methods.

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.

Return to top
Show:
© 2018 Microsoft