Arrows represent links between diagram nodes.
VB6
![]() |
---|
Public Class Arrow |
C++
![]() |
---|
class Arrow |
An arrow connects at most two nodes, which can be get or set via Origin and Destination properties. Alternatively, you can use the type-safe DestinationBox and OriginBox properties if the arrow connects boxes, or DestinationTable and OriginTable properties for tables. OriginType and DestinationType return the type of the nodes connected by an arrow. If linked to node anchor points, the point indices can be accessed using the OrgnAnchor and DestAnchor properties. To control whether users are allowed to move link end points, set AllowMoveStart and AllowMoveEnd.
Arrows are built of parts called segments, which can be straight lines, cascading orthogonal lines or Bezier curves. The type of segments is set through the Style property. The number of arrow's segments is specified via the Segments property. The locations of control points can be changed through the CtrlPtX, CtrlPtY properties and the Update method.
Usually only the starting and ending segments of an arrow are updated if the nodes it connects are moved around. The number, orientation and/or position of arrow segments can change dynamically as set in the Dynamic and AutoRoute properties. For arrows whose Style is set to asPerpendicular, the PrpStartOrientation property specifies the orientation of their first segments. How an arrow behaves when nodes are moved around depends on the values of Dynamic and AutoRoute properties.
If SnapToNodeBorder is enabled, an arrow automatically aligns its end points to the border of the origin or destination nodes when a user moves the first or last control points. This has a higher priority than aligning to the grid, but a lower priority than aligning to an anchor point.
Arrows can display distinct arrowhead shapes at their ends. These shapes can be set with the ArrowHead and ArrowBase properties. The size of the base and arrowhead images is specified via the ArrowHeadSize and ArrowBaseSize properties. Arrowhead shapes can be displayed in the middle of each segment to facilitate users by distinguishing different arrows. The type and size of these shapes is set with the IntermArrowHead and IntermHeadSize properties.
The arrow segments are drawn using a pen whose attributes are specified via the Color, PenStyle and PenWidth properties. The fill color of the arrowhead shapes can be set through the FillColor property. The appearance of arrow's selection handles can be changed using SelStyle.
An arrow can display one text label, whose text is set through the Text property. The text formatting can be customized via the Font, TextColor and TextStyle properties. To change the label position, call the SetTextPosition method.
The ArrowLabel class available since version 4.8 allows multiple captions to be displayed for a single Arrow object. Labels provide a set of properties allowing full customization of their display and positioning. Labels can also be arranged automatically to avoid overlapping nodes and other labels by setting AutoArrange to true. You can modify and access the list of arrow's labels using AddLabel, RemoveLabel, GetLabel methods of the Arrow class. The LabelFromPoint method lets you find the label placed at a specific location.
There are several utility methods that can be used for hit testing. IntersectsNode determines whether an arrow intersects any part of a node, taking into account the node's shape. The Length property of an arrow returns the total length of the arrow's segments.