Dim tr As WinForm.TreeView =
e.Form.Controls("TreeView1")
Dim nd As WinForm.TreeNode = tr.SelectedNode
Dim id As
Integer
= nd.index
If nd.ParentNode Is Nothing
Then
nd = tr.Nodes.Insert("新节点","新节点",id)
Else
nd = nd.ParentNode.Nodes.Insert("新节点","新节点",id)
End
If
tr.SelectedNode = nd '选择新插入的节点
tr.Select
'选择目录树