好像只有个点击时间。无法分辨左右击。
Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)
盼大侠告知解决方法。谢谢!

解决方案 »

  1.   

    是有MouseDown事件的,你再看看
    Private Sub tvwData_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
         if Button=vbLeftButton Then
         End If
         If Button=vbRightBotton Then
         End If
    End Sub
      

  2.   

    to lilaclone(~~阿九~~) 
    我说的是节点点击的左右点击事件,而不是整个树控件的左右点击事件.请指教!!
      

  3.   

    Private Sub tvwData_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) 
        '鼠标弹起时,并返回当前节点,并判断单击左键还是右键。根据左右键不同调用不同处理程序    Dim nodeX As Node
        
        '返回你说点击的Node对象
        Set nod = tvwData.HitTest(x, y)     '没有节点,进入错误处理部分
        On Error GoTo EmptyNode   
        
        '设置你所点击的Node对象被选中
        nod.Selected = True        '检测鼠标的点击
        If Button = vbRightButton Then '右键
    '写入你的处理代码
        ElseIf Button = vbLeftButton Then '左键
    '写入你的处理代码
        Endif
        
        Exit SubEmptyNode:
        '错误处理代码
    End Sub
      

  4.   

    可以根据tvwData.Nodes(intCount).Key(键值)及tvwData.Nodes(intCount).Text(显示文字)的值来判断选中的是哪个节点