Type | Description | |||
Node | A Node object that identifies the first child node. |
Use the FirstNode property to get the first child node. The FirstNode property gets nothing, if the node has no child nodes. Use the NextNode property to determine the next sibling node. Use the NodeCount property to get the number of child nodes. Use the Position property to change the node's position. Use the LastNode property to determine the last child node. 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