Dear All,
I am trying to select a node using right click.But it is not selecting that particular
item.How to solve this problem
Dana
Printable View
Dear All,
I am trying to select a node using right click.But it is not selecting that particular
item.How to solve this problem
Dana
Hi Dana, try this:
Code:Private Sub TreeView_MouseDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.MouseEventArgs) _
Handles TreeView.MouseDown
If e.Button = Windows.Forms.MouseButtons.Right Then
Treeview.SelectedNode= TreeView.GetNodeAt(e.X, e.Y)
End If
End Sub
vb Code:
Private Sub treeview1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles treeview1.MouseDown If e.Button = Windows.Forms.MouseButtons.Right Then treeview1.SelectedNode = treeview1.GetNodeAt(e.X, e.Y) End If End Sub