ASP.NET Pack Programmer's Guide
DiagramLink.ControlPoints Property
See Also
 





Gets a collection of the control points of this link.

Namespace: MindFusion.Diagramming
Package: MindFusion.Diagramming

 Syntax

C#  Copy Code

public PointCollection ControlPoints { get; }

Visual Basic  Copy Code

Public ReadOnly Property ControlPoints As PointCollection

 Property Value

A collection of control points that specify the link's shape.

 Remarks

You can specify new positions of a link's points through that property. The number of points in the collection depends on the Shape and SegmentCount of the link. Links made of Bézier-splines has four control points for each segment. Links of the other styles have two control points per segment. Adjacent segments share a common control point. Check the Count property of the collection to get the number of points. After setting new positions of control points you must call the UpdateFromPoints method.

 Example

The following example demonstrates how to programmatically setup the control points of a link:

C#  Copy Code

DiagramLink link;
PointF cpt;

link = Diagram.Links[0];

// Move the second and the third points
cpt = link.ControlPoints[1];
link.ControlPoints[1] = new PointF(cpt.X + 5, cpt.Y);
link.ControlPoints[2] = new PointF(22.2f, 33.3f);

// Update state and redraw
link.UpdateFromPoints();

Visual Basic  Copy Code

Dim link As DiagramLink
Dim cpt As PointF

link = diagram.Links(0)

' Move the second and the third points
cpt = link.ControlPoints(1)
link.ControlPoints(1) = New PointF(cpt.X + 5, cpt.Y)
link.ControlPoints(2) = New PointF(22.2, 33.3)

' Update state and redraw
link.UpdateFromPoints()

 See Also

DiagramLink Members
DiagramLink Class
MindFusion.Diagramming Namespace
UpdateFromPoints Method
StartPoint Property
EndPoint Property