"Sam" <sa************ **@voila.fr> schrieb:
I'd like to get the selected node when the user select a node in my
treeview. I know how to get the selected node, what I don't know is how
to detect that the user has selected a new node.
\\\
Private Sub TreeView1_After Select( _
ByVal sender As Object, _
ByVal e As TreeViewEventAr gs :
) Handles TreeView1.After Select
Static LastNode As TreeNode
Dim CurrentNode As TreeNode = _
Me.TreeView1.Ge tNodeAt(Me.Tree View1.PointToCl ient(Cursor.Pos ition))
If Not CurrentNode Is LastNode Then
LastNode = CurrentNode
If Not CurrentNode Is Nothing Then
MsgBox(CurrentN ode.Text)
Else
MsgBox("No node selected!")
End If
End If
End Sub
///
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>