[RESOLVED] Help on TreeView set focus
How to set focus on a treeview node when i right click the mouse?
The code should like this but never work.
-------------------------------
if e.Button = Windows.Forms.MouseButtons.Right then
focus(treeview1.selectednode)
end if
-------------------------------
thanks in advence.
Re: Help on TreeView set focus
Code:
Private Sub TreeView1_NodeMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles TreeView1.NodeMouseClick
If e.Button = Windows.Forms.MouseButtons.Right Then
Me.TreeView1.SelectedNode = e.Node
End If
End Sub
Re: Help on TreeView set focus
work great, thank you guys!