Type | Description | |||
Node | A Node object that identifies the parent of the node. |
Use the Parent property to get the parent of the node. Use the Parent property to move a node from a parent to another. The Parent property gets nothing if the node has no parent. The root node has no parent. Use the Root property to access the root node of the organigram. Use the Item property to access an item/node by its key. Use the FirstNode property to retrieve the first child node. Use the NextNode property to determine the next sibling node. 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 changes the node's parent by dragging:
Dim n As Node Private Sub ChartView1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Set n = ChartView1.NodeFromPoint(-1, -1) If Not (n Is Nothing) Then If n.IsAssistant Or n.IsGroup Then Set n = Nothing End If End If End Sub Private Sub ChartView1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) If (Button = 1) Then If Not (n Is Nothing) Then Dim nNew As Node Set nNew = ChartView1.NodeFromPoint(-1, -1) If Not (nNew Is Nothing) Then If Not nNew.IsAssistant And Not nNew.IsGroup Then n.Parent = nNew End If End If End If End If End Sub
The following VB sample moves the "wnd" node to "gdi" node:
With ChartView1.Nodes .Item("wnd").Parent = .Item("gdi") End With
When moving a node from a parent to another you need to be sure: