Results 1 to 3 of 3

Thread: [RESOLVED] [2005] Tree RightClick

  1. #1

    Thread Starter
    Learning .Net danasegarane's Avatar
    Join Date
    Aug 2004
    Location
    VBForums
    Posts
    5,853

    Resolved [RESOLVED] [2005] Tree RightClick

    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
    Please mark you thread resolved using the Thread Tools as shown

  2. #2
    Lively Member Shardox's Avatar
    Join Date
    Nov 2006
    Location
    Barcelona, Spain
    Posts
    123

    Re: [2005] Tree RightClick

    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

  3. #3
    Registered User RaviIntegra's Avatar
    Join Date
    Mar 2007
    Location
    Pondicherry, India
    Posts
    125

    Re: [2005] Tree RightClick

    vb Code:
    1. Private Sub treeview1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles treeview1.MouseDown
    2.         If e.Button = Windows.Forms.MouseButtons.Right Then
    3.             treeview1.SelectedNode = treeview1.GetNodeAt(e.X, e.Y)
    4.         End If
    5.     End Sub

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