子节点上不止一个父节点,如何将点击的子节点所有父节点全部列出来
望高手们指点~注:不要给基础理论的东西,我完全没有基础的,请给出完整可行的源代码,谢谢
我在网上看过很多回复:Node.Parent.Text
还有一些过程:
Function GetPath(oRoot As Node, desNode As Node) As String
Dim strt As String
strp = ""
Do Until desNode Is oRoot
If strt <> "" Then
strt = "\" & strt
End If
strt = desNode.Text & strt
Set desNode = desNode.Parent
Loop
GetPath = strt
End Function但有又不写如何调用,我又看不懂,试来试去除了出错还是出错~~真是晕死~~
望高手们指点~注:不要给基础理论的东西,我完全没有基础的,请给出完整可行的源代码,谢谢
我在网上看过很多回复:Node.Parent.Text
还有一些过程:
Function GetPath(oRoot As Node, desNode As Node) As String
Dim strt As String
strp = ""
Do Until desNode Is oRoot
If strt <> "" Then
strt = "\" & strt
End If
strt = desNode.Text & strt
Set desNode = desNode.Parent
Loop
GetPath = strt
End Function但有又不写如何调用,我又看不懂,试来试去除了出错还是出错~~真是晕死~~
TreeView1.PathSeparator = "\"
TreeView1.Nodes.Add , , "r", "root"
TreeView1.Nodes.Add "r", tvwChild, "a", "a-302"
TreeView1.Nodes.Add "a", tvwChild, "b", "b-477"
End SubPrivate Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
Debug.Print Node.FullPath
End Sub