VisualTreeHelper.HitTest Method

 

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: