Beneath this is exactly what you ask, this is shows when it is selected, so
clicked)
\\\
Private Sub TreeView1_AfterSelect _
(ByVal sender As Object, ByVal e As _
System.Windows.Forms.TreeViewEventArgs) _
Handles TreeView1.AfterSelect
Dim mynodeText As String = e.Node.Text
End Sub
///
\\\
Private Sub TreeView1_Click(ByVal sender _
As Object, ByVal e As System.EventArgs) _
Handles TreeView1.Click
Dim myNodeText As String = _
DirectCast(sender, TreeView).SelectedNode.Text
End Sub
///
I hope this helps?
The Click event is raised when you click on any item in the treeview,
including the parent node you're trying to expand. In the end I ended up
using the DoubleClick event - and the users seem to be reasonably happy with
that.
The second sample does, however the first in my opinion not?
Where is my mistake?
However that first fires after the click when that is on a select of a node.
When you want first to select and than do an extra click, than I think that
you have to go to the solution from Dany. (Because there should be a distict
between a click and a double click).
Herfried got the solution to create the NodeClick event.
The code is like follows to call OpenMenu:
Private Sub tvMain_MouseUp(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles tvMain.MouseUp
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.