Search
Items Placement - Position, Size and Z-order

Location and Size of Nodes

Use the Bounds property to get or change the location and size of a node. To find nodes located at a specific position in the diagram, call the GetNodeAt method. To find a node in the vicinity of a point, call GetNearestNode.

Links Control Points

Links have two or more control points, depending on their Shape and SegmentCount. You can get access to the control points by the link's ControlPoints collection. You must call UpdateFromPoints after moving control points of a link; that's needed in order to repaint the link and update its internal state variables. The GetBounds method returns the smallest rectangle that bounds all link points. To find a link that passes near a specific point of the diagram, call the GetLinkAt method.

Link Dynamics

The Dynamic property of a link can be enabled to make the link automatically recalculate its end point positions if the nodes connected to the link are moved or resized; the end points are moved in such a way that the link points to the centers of the connected nodes.

Links have an AutoRoute property that enables or disables automatic routing of a link. Routed links avoid nodes by finding the shortest path between their origin and destination that does not cross any other nodes. The link routing algorithm can be tuned by using the properties exposed by RoutingOptions.

The AutoSnapLinks and AutoSnapDistance properties specify whether links should automatically snap to the nearest node while their end points are being moved.

Interactive Moving or Resizing

End-users of your application can move or resize the diagram elements. They do this by selecting an item and dragging any of its adjustment handles, a point inside its interior, any of its sides or a selection frame. The HandlesStyle property of nodes controls how interaction can be performed. Additionally it defines the representation of selected items on screen. EnabledHandles lets you disable specific manipulations users are allowed to perform on a node, for example resizing the item horizontally or moving it. If an item is modified interactively, the NodeModified or LinkModified event is raised, depending on the item's type.

Controlling the Z-order

The Z-order defines how items are ordered on the Z-axis - so that one looks above or below another. You can use the ZIndex property to get or set the index of an item within the Z-order array.