我的树视图如下:
由于
答案 0 :(得分:2)
就像使用节点的Nodes
集合的indexer属性一样简单,如下所示:
YourNode.Nodes(2).Text
如果您处理了TreeView的NodeMouseClick
事件,则第二个参数e as TreeNodeMouseClickEventArgs
可以像这样使用:
Public Sub YourTreeView_AfterSelect(sender As Object, e As System.Windows.Forms.TreeNodeMouseClickEventArgs)
If YourTreeView.SelectedNode.Nodes.Count > 2 Then
MsgBox(YourTreeView.SelectedNode.Nodes(2).Text)
Else
MsgBox("No 3rd node is available.")
End Sub
答案 1 :(得分:0)
感谢@dotNET
,得到了我想要的东西Private Sub TreeView1_Click(sender As Object, e As EventArgs) Handles TreeView1.AfterSelect
If TreeView1.SelectedNode IsNot Nothing AndAlso TreeView1.SelectedNode.Nodes.Count > 2 Then
Link = TreeView1.SelectedNode.Nodes(2).Text
End If
End Sub
由于