Search
DiagramBase.DrawAdjustmentHandles Event
See Also
 





Raised when item's adjustment handles must be custom-drawn.

Namespace: MindFusion.Diagramming
Assembly: MindFusion.Diagramming

 Syntax

C#  Copy Code

public event EventHandler<DrawItemEventArgs> DrawAdjustmentHandles

Visual Basic  Copy Code

Public Event DrawAdjustmentHandles As EventHandler(Of DrawItemEventArgs)

 Event Data

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

Member name

Description

Item

The DiagramItem whose adjustment handles should be drawn.

Graphics

An object implementing the IGraphics interface whose methods should be used to draw the item's handles.

 Remarks

DrawAdjustmentHandles is raised for selected items whose HandlesStyle is set to Custom.

 Example

The following example illustrates how to draw a red frame around a node as a visualization of its adjustment handles.

C#  Copy Code

void OnDrawAdjustmentHandles(object source, DrawItemEventArgs e)
{
    var pen = new MindFusion.Drawing.Pen(Colors.Red, 0);

    if (e.Item is ShapeNode shapeNode)
    {
        e.Graphics.DrawRectangle(
            pen, shapeNode.Bounds);
    }

    if (e.Item is DiagramLink link)
    {
        e.Graphics.DrawLines(
            pen, link.ControlPoints);
    }
}

 See Also