问道vb题,谢谢

来源:百度知道 编辑:UC知道 时间:2024/06/12 03:47:07
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button And 2) = 2 Then
Print "AAAA";
End If
End Sub

为什么同时按左右键,不能成功在窗体上输出“AAAA”啊?谢谢

你的过程是mousemove,按住鼠标键然后移动鼠标,才能触发这个过程。
用Form_MouseUp

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 3 Then
Print "AAAA";
End If
End Sub

If (Button And 2) = 2 Then 改成
if (Button And vbrightButton) > 0 then