Monday, July 25, 2011

Determine which Treeview node was clicked

In my example to determine which Treeview node was clicked i will use the both, MsgBox and TextBox.
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
 
 

1 comment:

  1. 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

There was an error in this gadget