is there a way to determine which TreeView node we are hovering over

J

Just Me

With a TreeView control and a MouseHover event
is there a way to determine which node we are hovering over?


Thanks in advance
 
H

Herfried K. Wagner [MVP]

Just Me said:
With a TreeView control and a MouseHover event
is there a way to determine which node we are hovering over?

\\\
Private Sub TreeView1_MouseMove( _
ByVal sender As Object, _
ByVal e As MouseEventArgs _
) Handles TreeView1.MouseMove
Static LastNode As TreeNode
Dim CurrentNode As TreeNode = _
Me.TreeView1.GetNodeAt(e.X, e.Y)
If Not CurrentNode Is LastNode Then
LastNode = CurrentNode
If Not CurrentNode Is Nothing Then
Me.Text = CurrentNode.Text
Else
Me.Text = "(no node hovered)"
End If
End If
End Sub
///
 

Ask a Question

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.

Ask a Question

Top