Search
DiagramBase.HitTestAdjustmentHandles Event
See Also
 





Raised when custom hit testing of item's adjustment handles must be performed.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public event EventHandler<HitTestEventArgs> HitTestAdjustmentHandles

Visual Basic  Copy Code

Public Event HitTestAdjustmentHandles As EventHandler(Of HitTestEventArgs)

 Event Data

HitTestAdjustmentHandles event handlers receive an argument of type HitTestEventArgs. The following HitTestEventArgs members provide information relevant to the event:

Member name

Description

Item

A DiagramItem whose adjustment handles should be hit tested.

MousePosition

A Point specifying the mouse cursor position.

HitResult

Set this property to the index of the adjustment handle that has been hit.

 Remarks

For links, set the result to the index of the link's control point that has been hit. For nodes, set the result to 0, 1, 2, 3 for the corner resize handles, 4, 5, 6, 7 for the side center resize handles, 8 for the move handle and 9 for the rotation handle.

 Example

C#  Copy Code
void diagram_HitTestAdjustmentHandles(object sender, HitTestEventArgs e)
{
    ShapeNode shapeNode = e.Item as ShapeNode;
    if (shapeNode != null)
    {
        if (shapeNode.Bounds.Contains(e.MousePosition))
        {
            // Always move
            e.HitResult = 8;
        }
    }
}
Visual Basic  Copy Code

Private Sub diagram_HitTestAdjustmentHandles(ByVal sender As Object, ByVal e As HitTestEventArgs) Handles diagram.HitTestAdjustmentHandles

    Dim shapeNode As ShapeNode = CType(e.Item, ShapeNode)

    If Not shapeNode Is Nothing Then

        If (shapeNode.Bounds.Contains(e.MousePosition)) Then

            ' Always move
            e.HitResult = 8

        End If

    End If

End Sub

 See Also