帮助获取选定的Treeview节点的文本 [英] help getting the selected treeview node's text

查看:109
本文介绍了帮助获取选定的Treeview节点的文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用树视图,而我的总体目标是当用户选择特定节点时,它会显示与之配套的用户控件.我已经编制了所有代码,但是如何在用户选择节点文本信息时获取它们.

我已经尝试过

I am working with a treeview and my over all goal is when a user selects a specific node it display the usercontrol that goes with it. I have all the code worked out but how to get the nodes text information when a user selects it.

i have tried

Private Sub TrVFixes_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles TrVFixes.Click
    Dim str = TrVFixes.SelectedNode.Text
    MsgBox(str).ToString()
End Sub



如果有人可以告诉我如何在单击时获得节点文本信息,那将是很好的.



if someone could show me how i can get the nodes text information on click that would be great.

推荐答案

我知道了.下面是代码.

I figured it out. Below is the code.

Private Sub TrVFixes_NodeMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles TrVFixes.NodeMouseClick
    MsgBox(e.Node.Text)
End Sub


这篇关于帮助获取选定的Treeview节点的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆