你这是用特殊键来充当热键
建议用GetAsyncKeyState
当然如果用MouseDown的话
先设定两个全局变量
dim LDown as boolean
dim RDown as boolean
再判断
Private sub xxx_MouseDown(.....
if button=2 then
if ldown=true then ....
rdown=true
end if
在mouseup中还原
Private sub xxx_MouseUp(.....
ldwon=false
rdown=false
....
Windows 中好像没有两个按键同时按下的消息。只能先生左键按下事件,再生右键按下事件,或反之。
我认为只能判断两键按下的时间间隔来判断用户是否同时按下了左右两键。
愚人的程序如下。
添加两个窗体级布尔变量bleft,bright
先在Form_MouseDown事件中写以下代码
If Button = 1 Then bleft = True
If Button = 2 Then bright = True
If bleft And bright Then
bleft = False
bright = False
MsgBox "You press Left Button and Right Button together"
End If
这是判断两个按键是否分别都已经按下。