method Node.AddAssistant (Caption as String, [Image as Variant], [Picture as Variant])
Adds an assistant node.

   Caption as String A string expression that identifies the node's caption. The Caption supports built-in HTML tags.  
   Image as Variant A long expression that indicates the index of the icon being assigned to the node.  
   Picture as Variant A string expression that indicates the path to the picture file being loaded by the node, a IPictureDisp object that specifies the picture of the node  
  NodeA Node object being created. 

Use the AddAssistant method to add assistant nodes.  An assistant node is displayed between a child node and its parent. The Node being returned by the AddAssistant method has the IsAssistant property on True.  The control displays the assistant nodes only if the ShowAssistants property is True. An assistant node is displayed only if the parent node contains child nodes. By default, the control aligns the assistant nodes like follows: first assistant node is aligned to the left, the second assistant node is aligned to the right, the third assistant node to the left and so on. The Left property aligns the node to the left or right side of the link between child nodes and their parent. Use the Caption property to change the node's caption at runtime. Use the Assistant property to access the assistant nodes collection. Use the RemoveAssistant  method to remove an assistant node. Use the PenLinkAssistant property to define the type of the pen used to paint the links between assistant nodes. Please not that an assistant node is shown between parent and child node, so if the node is not expanded, or has no childs, the assistant nodes are not shown.

The Caption parameter supports the following built-in HTML tags:

Newer HTML format supports subscript and superscript like follows:

Newer HTML format supports decorative text like follows:

In the following image, the red node represents an assistant node:

The following VB sample adds an assistant node to the root object:

Private Sub Form_Load()
    With ChartView1
        With .Root
            .Caption = "<r><dotline><b>CObject</b><br>CObject is the principal base class for the Microsoft Foundation Class Library.<br><upline><dotline>Methods:<r>4"
            With .AddAssistant("Jhon Frederick<br><r>HR Secretary<br><fgcolor=0000FF><u></u></fgcolor><br>Tel:<r>+40-744-845288", 1)
                Left = False
            End With
        End With
        With .Nodes
            .Add "Child 1"
            .Add "Child 2"
        End With
    End With
End Sub

The following C++ sample adds an assistant node to the root object:

COleVariant vtMissing; V_VT( &vtMissing ) = VT_ERROR;
CNode node = m_chartview.GetRoot();
CNode assistant = node.AddAssistant( "New Assistant", vtMissing, vtMissing );
assistant.SetBackColor( RGB(0,0,255) );
assistant.SetForeColor( RGB(255,255,255) );

The following VB.NET sample adds an assistant node to the root object:

With AxChartView1.Root
    With .AddAssistant("New Assistant")
        .ForeColor = ToUInt32(Color.White)
        .BackColor = ToUInt32(Color.Blue)
    End With
End With

where the ToUInt32 function converts a Color expression to OLE_COLOR,

Shared Function ToUInt32(ByVal c As Color) As UInt32
    Dim i As Long
    i = c.R
    i = i + 256 * c.G
    i = i + 256 * 256 * c.B
    ToUInt32 = Convert.ToUInt32(i)
End Function

The following C# sample adds an assistant node to the root object:

EXORGCHARTLib.Node node = axChartView1.Root.AddAssistant("New Assistant", null, null);
node.ForeColor = ToUInt32(Color.White);
node.BackColor = ToUInt32(Color.Blue);

where the ToUInt32 function converts a Color expression to OLE_COLOR,

private UInt32 ToUInt32(Color c)
	long i;
	i = c.R;
	i = i + 256 * c.G;
	i = i + 256 * 256 * c.B;
	return Convert.ToUInt32(i);

The following VFP sample adds an assistant node to the root object:

with thisform.ChartView1.Root
	with .AddAssistant( "New Assistant" )
		.ForeColor = RGB(255,255,255)
		.BackColor = RGB(0,0,255)


Send comments on this topic.
1999-2016 Exontrol.COM, Software. All rights reserved.