我的菜单结构为:  
标题:  文件  
名称:    nemufile  
                   ...打开  
                       nemuopen  
                   ...修改  
                       nemumodify  
 
请问如何实现鼠标右键响应:nemuopen_click  事件?  
请高手帮忙!!!!谢谢!!!!

解决方案 »

  1.   

    Private Sub nemuopen_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 2 Then
            MsgBox "鼠标右键被按下"
        End If
    End Sub
      

  2.   


    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
     If Button = 2 And Shift = 0 Then
     PopupMenu Form1.nemufile
      If nemuopen = True Then
       MsgBox "open", vbOKOnly + vbExclamation, "hello"
       ElseIf nemuExit = True Then
          MsgBox "Exit", vbOKOnly + vbExclamation, "hello"
       End If
      End If
    End Sub我为什么按下菜单中的“Exit”项时,弹出的不是“Exit”对话框?
    我的意思是:象上面那样,在form 过程中,调用鼠标右键按下时,“打开”事件被激活。
    是怎么实现的。
    谢谢高手给我回复!!!!
      

  3.   

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
            If Button = vbRightButton Then
                Me.PopupMenu File, vbPopupMenuRightButton, X, Y '这样就支持了
            End If
    end sub
      

  4.   

    vbPopupMenuRightButt
    请问这是什么?
    我还是不能实现根据需要,显示不同的对话框!
    急救!!!谢谢!!!!
      

  5.   

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
     If Button = 2 And Shift = 0 Then
        nemuopen_click  
     End If
    End Sub
      

  6.   

    将这个菜单事件前的Private 改成 Public ,然后就可以在另一个Form 中调用了
      

  7.   

    在菜单项的Click事件中写呀!
      

  8.   

    Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = 2 Then  '当鼠标右键被按下时,参数Button等于2。
      PopupMenu nemufile,vbPopupMenuRightButton
    End If
    End Sub
      

  9.   

    可以实现的:把你需要显示的菜单的Visible用代码设置为False,不需要显示的设置为True,就可以了。如有a,b,c,只显示c
    a。visible =false
    b。visible =false
    c。visible =True