TreeView Control and Node Click 
Author Message
 TreeView Control and Node Click

On 24 Jan 1997 11:21:37 GMT, "Kevin Bowdler"

Quote:

>Does anyone have a way to right click on a node and select it, So a popup
>menu could be displayed

Here's an excerpt from a piece of code I wrote some time back:  

Private Sub TreeView1_MouseDown(Button As Integer, _
                                          Shift As Integer,_
                                          X As Single, _
                                          Y As Single)
    Select Case Button
        Case vbLeftButton
            '....stmts for left click
        Case vbRightButton
            Call RightClick(X, Y)
        Case Else
    End Select
End Sub

Private Sub RightClick(ByVal X As Single, _
                                   ByVal Y As Single)
    Dim nodx As Node

    Set nodx = TreeView1.HitTest(X, Y)
    If Not nodx Is Nothing Then
        nodx.Selected = True
        TreeView1.SelectedItem = nodx
    End If
    If Not (nodx Is TreeView1.SelectedItem.Root) Then PopupMenu
mnuNodes
    Set nodx = Nothing
End Sub

Jeff



Tue, 13 Jul 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Access the node that was clicked on with in a TreeView control

2. Treeview: highlight node with control Click event

3. TreeView-Control, activate Node with right mouse click

4. Double clicking a Node in the Treeview Control

5. TREEVIEW Ctrl :detecting if a node has been selected/clicked

6. No node click event in Windows.Forms.TreeView?

7. TreeView -Click Event on Plus Sign Node

8. Right Click Treeview Doesnt Select Node

9. Treeview - detecting click on node icons

10. Right mouse click on Treeview Node

11. Right mouse click on Treeview Node

12. TreeView - Node click cancel

 

 
Powered by phpBB® Forum Software