This documentation is archived and is not being maintained.
PointHitTestResult Class
Visual Studio 2008
Represents the results of a hit test that uses a Point as a hit test parameter.
Assembly: PresentationCore (in PresentationCore.dll)
You can also perform a hit test on a visual object by using a Geometry as a hit test parameter and returning the result as a GeometryHitTestResult. For more information, see How to: Hit Test Using Geometry as a Parameter.
The following example shows how to retrieve the PointHitTestResult return value from the HitTest method.
// Respond to the left mouse button down event by initiating the hit test. private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // Retrieve the coordinate of the mouse position. Point pt = e.GetPosition((UIElement)sender); // Perform the hit test against a given portion of the visual object tree. HitTestResult result = VisualTreeHelper.HitTest(myCanvas, pt); if (result != null) { // Perform action on hit visual object. } }
System.Object
System.Windows.Media.HitTestResult
System.Windows.Media.PointHitTestResult
System.Windows.Media.AdornerHitTestResult
System.Windows.Media.HitTestResult
System.Windows.Media.PointHitTestResult
System.Windows.Media.AdornerHitTestResult
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: