Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

PointHitTestResult.PointHitTestResult Constructor

Initializes a new instance of the PointHitTestResult class.

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

public PointHitTestResult (
	Visual visualHit,
	Point pointHit
)
public PointHitTestResult (
	Visual visualHit, 
	Point pointHit
)
public function PointHitTestResult (
	visualHit : Visual, 
	pointHit : Point
)
You cannot use constructors in XAML.

Parameters

visualHit

The Visual object that represents the hit test result.

pointHit

The Point object that represents the hit test result.

The following example shows how to override default hit test support in a user-defined visual object. In this case, a new PointHitTestResult is created and returned from the overridden method.

// Override default hit test support in visual object.
protected override HitTestResult HitTestCore(PointHitTestParameters hitTestParameters)
{
    Point pt = hitTestParameters.HitPoint;

    // Perform custom actions during the hit test processing,
    // which may include verifying that the point actually
    // falls within the rendered content of the visual.

    // Return hit on bounding rectangle of visual object.
    return new PointHitTestResult(this, pt);
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0

Community Additions

ADD
Show:
© 2015 Microsoft