get selected node from mouse right click

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi, the treeview only selects a tree node when clicked with the left mouse
button...how can i get it to select a node with the right mouse button?

thanks
 
In the mousedown , you can use e.x and e.y along with HitTest method to get
the nodeclicked... I don't have the exact code in the pile I have here... I
found a sample from CodeProject to use.. you check the site out...

Vijay
 
Here is how you do in version 1.1.. and 2003


If e.Button = MouseButtons.Right Then
Dim currNode As TreeNode
Dim ClickPoint As Point = New Point(e.X, e.Y)
currNode = TreeViewControl1.GetNodeAt(ClickPoint)
If currNode Is Nothing Then
Return
End If
If Not TypeOf currNode.Tag Is TreeTag Then
Return
End If
End If

VJ
 
Back
Top