PointHitTestParameters(Point) PointHitTestParameters(Point) PointHitTestParameters(Point) Constructor

定義

PointHitTestParameters クラスの新しいインスタンスを Point に初期化します。Initializes a new instance of the PointHitTestParameters class, using a Point.

public:
 PointHitTestParameters(System::Windows::Point point);
public PointHitTestParameters (System.Windows.Point point);
new System.Windows.Media.PointHitTestParameters : System.Windows.Point -> System.Windows.Media.PointHitTestParameters

パラメーター

point
Point Point Point

Point の値として指定するパラメーター。The parameter that is specified as the Point value.

次の例を呼び出す方法を示しています。HitTestを使用して、PointHitTestParameters値。The following example shows how to invoke HitTest by using a PointHitTestParameters value.

// Respond to the right mouse button down event by setting up a hit test results callback.
private void OnMouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
    // Retrieve the coordinate of the mouse position.
    Point pt = e.GetPosition((UIElement)sender);

    // Clear the contents of the list used for hit test results.
    hitResultsList.Clear();

    // Set up a callback to receive the hit test result enumeration.
    VisualTreeHelper.HitTest(myCanvas, null,
        new HitTestResultCallback(MyHitTestResult),
        new PointHitTestParameters(pt));

    // Perform actions on the hit test results list.
    if (hitResultsList.Count > 0)
    {
        Console.WriteLine("Number of Visuals Hit: " + hitResultsList.Count);
    }
}
' Respond to the right mouse button down event by setting up a hit test results callback.
Private Overloads Sub OnMouseRightButtonDown(ByVal sender As Object, ByVal e As MouseButtonEventArgs)
	' Retrieve the coordinate of the mouse position.
	Dim pt As Point = e.GetPosition(CType(sender, UIElement))

	' Clear the contents of the list used for hit test results.
	hitResultsList.Clear()

	' Set up a callback to receive the hit test result enumeration.
	VisualTreeHelper.HitTest(myCanvas, Nothing, New HitTestResultCallback(AddressOf MyHitTestResult), New PointHitTestParameters(pt))

	' Perform actions on the hit test results list.
	If hitResultsList.Count > 0 Then
		Console.WriteLine("Number of Visuals Hit: " & hitResultsList.Count)
	End If
End Sub

適用対象