We are using EventArg object to get the clicked node object.
MsgBox
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect MsgBox.Show(e.Node.Text) End Sub
TextBox
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, _ ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect TextBox1.Text = e.Node.Text End Sub
Wow excellent. Keep up the good work. I have been searching for such a complete web site that offers vb.net code for free. It is a good start for beginers and advanced users.
ReplyDelete