Search
Arrow.AddLabel Method
See Also
 



Adds the specified label to this arrow.

 Syntax

VB6  Copy Code

Public Sub AddLabel( _
    ByVal label As ArrowLabel _
)

C++  Copy Code

public:
void AddLabel (
    ArrowLabel* label
)

 Parameters

label

An ArrowLabel instance.

 Remarks

Main text content of an arrow is specified via its Text property. Call AddLabel if you need to display additional text labels, such as identifiers or hints to the user.

Call RemoveLabel to remove the label later. You can access all labels assigned to an arrow by means of the GetLabelCount and GetLabel methods.

 Example

The following ArrowCreated event handler adds two supplementary labels near arrow's end points.

VB6  Copy Code

Sub fcx_ArrowCreated(ByVal arrow As FLOWCHARTLibCtl.IArrowItem)
    Dim label1 As ArrowLabel
    Set label1 = New ArrowLabel
    label1.SetLinkLengthPosition 0.1
    label1.AutoArrange = True
    label1.Text = "org: 1"
    arrow.AddLabel label1

    Dim label2 As ArrowLabel
    Set label2 = New ArrowLabel
    label2.SetLinkLengthPosition 0.9
    label2.AutoArrange = True
    label2.Text = "dest: 1"
    arrow.AddLabel label2
End Sub

C++  Copy Code

void DiagramWindow::OnArrowCreated(LPDISPATCH pArrowItem)
{
    ArrowItem arrow = pArrowItem;

    ArrowLabel label1;
    label1.CreateDispatch(_T("FlowChartPro.ArrowLabel"));
    label1.SetLinkLengthPosition(0.1f);
    label1.SetAutoArrange(TRUE);
    label1.SetText(_T("org: 1"));
    arrow.AddLabel(label1);

    ArrowLabel label2;
    label2.CreateDispatch(_T("FlowChartPro.ArrowLabel"));
    label2.SetLinkLengthPosition(0.9f);
    label2.SetAutoArrange(TRUE);
    label2.SetText(_T("dest: 1"));
    arrow.AddLabel(label2);

    arrow.DetachDispatch();
}

 See Also