property Node.LastNode as Node
Gets the last child node.

TypeDescription
Node A Node position that specifies the last child node.

The LastNode property determines the last  child node. If the node has no child nodes, the LastNode property gets nothing. Use the FirstNode property to determine the first child node. Use the NodeCount property to get the number of child nodes. Use the Position property to change the node's position. Use the Nodes property to access the nodes collection. Use the Add method to add a child node.

The following VB sample enumerates recursively all the child nodes: 

Private Sub enumRec(ByVal n As EXORGCHARTLibCtl.Node)
    Dim c As EXORGCHARTLibCtl.Node
    Set c = n.FirstNode
    While Not c Is Nothing
        Debug.Print c.Caption
        enumRec c
        Set c = c.NextNode
    Wend
End Sub

The following C++ sample enumerates recursively all the child nodes: 

void enumRec( CNode* pNode )
{
	if ( pNode != NULL )
	{
		CNode child = pNode->GetFirstNode();
		while ( child.m_lpDispatch != NULL )
		{
			OutputDebugString( child.GetCaption() );
			OutputDebugString( "\r\n" );
			enumRec( &child );
			child = child.GetNextNode();
		}
	}
}

The following VB.NET sample enumerates recursively all the child nodes: 

Private Sub enumRec(ByVal n As EXORGCHARTLib.Node)
    Dim c As EXORGCHARTLib.Node = n.FirstNode
    While Not c Is Nothing
        Debug.Print(c.Caption)
        enumRec(c)
        c = c.NextNode
    End While
End Sub

The following C# sample enumerates recursively all the child nodes: 

private void enumRec(EXORGCHARTLib.Node node)
{
	EXORGCHARTLib.Node child = node.FirstNode;
	while (child != null)
	{
		System.Diagnostics.Debug.WriteLine(child.Caption);
		enumRec(child);
		child = child.NextNode;
	}
}

The following VFP sample enumerates recursively all the child nodes: 

LPARAMETERS node

local child
child = node.FirstNode
do while ( !isnull( child ) )
	wait window nowait child.Caption
	thisform.enumrec( child )
	child = child.NextNode
enddo