Search
AnchorPattern Class
Remarks See Also
 



An AnchorPattern instance defines a set of anchor points to be used together. A pattern can be assigned as an integral entity to the AnchorPattern property of diagram nodes.

 Syntax

VB6  Copy Code

Public Class AnchorPattern

C++  Copy Code

class AnchorPattern

 Remarks

Anchor patterns are identified by their string id, so be sure to assign an id to the pattern once it has been created. When the PatternId property is set, the pattern is also added to AnchorPatterns array of the FlowChart class. That array initially contains four predefined patterns.

Anchor points are added to a pattern through the AddAnchorPointF method. Arrows drawn from an anchor point can be assigned a specific Style and number of Segments, as specified via SetArrowStyleForPoint. The attributes of an existing anchor point can be accessed by means of GetAnchorPointF.

 Example

The following example shows how to define a new anchor pattern, and how to assign an anchor pattern to a box:

VB6  Copy Code

Private Sub Form_Load()

    Dim ap As New AnchorPattern
    ap.AddAnchorPoint 0, 20, True, True, msX, vbRed
    ap.AddAnchorPoint 0, 40, True, True, msX, vbRed
    ap.PatternId = "pattern1"

End Sub

Private Sub Command1_Click()

    fcx.boxes(0).AnchorPattern = fcx.AnchorPatterns("pattern1") 'use custom pattern
    fcx.boxes(1).AnchorPattern = fcx.AnchorPatterns("Decision2In2Out") 'use predefined pattern

End Sub

 See Also