VB中如何给按钮设置右键点击事件?(非常菜

2024-12-02 04:35:32
推荐回答(2个)
回答1:

直接调用鼠标事件啊

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
if button = 2 then
这里写你想要的代码
end if
End Sub

回答2:

Private Sub Form_MouseDown (Button As Integer,_
Shift As Integer, X As Single, Y As Single)
If Button = 1 then '左键
endif
If Button = 2 then '右键
endif
End Sub