单独在目录树增加节点时,即使已有的节点名称,也可以再增加同名的同节点,这个怎么排除或提示“该级位置存在同名的节点”。 谢谢~
Dim tr As WinForm.TreeView = e.Form.Controls("TreeView1")
Dim nd As WinForm.TreeNode = tr.SelectedNode
If nd IsNot Nothing Then
for each sn as WinForm.TreeNode in nd.nodes
if sn.name = "abc" then
return
end if
next
End If
nd.nodes.add("abc","abc")