Results 1 to 3 of 3

Thread: [RESOLVED] Help on TreeView set focus

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    41

    Resolved [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.
    VB.net - A power tool for my engineering life.

  2. #2
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    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

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2008
    Posts
    41

    Re: Help on TreeView set focus

    work great, thank you guys!
    VB.net - A power tool for my engineering life.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width