Search
DiagramBase.HitTestAdjustmentHandles Event
See Also
 





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

Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming

 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 PointF specifying the mouse cursor position.

HitResult

Set this property to an AdjustmentHandle instance representing the handle that has been hit.

 Remarks

For links, set the result to a LinkAdjustmentHandle initialized with the index of the link's control point that has been hit. For nodes, set the result to a NodeAdjustmentHandle initialized with a NodeHandleType enumeration member.

 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 = new NodeAdjustmentHandle(NodeHandleType.Move);
        }
    }
}
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 = New NodeAdjustmentHandle(NodeHandleType.Move)

        End If

    End If

End Sub

 See Also