100分急求vb hotkey相关问题

[复制链接]
查看11 | 回复4 | 2009-7-2 12:01:03 | 显示全部楼层 |阅读模式
用一个boolean类型的变量flag来控制,避免连击导致的错误,flag初始值为truePrivate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)If flag = True And KeyCode = vbKeyLeft Thenflag = False'call a1End IfEnd SubPrivate Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)If flag = False And KeyCode = vbKeyLeft Thenflag = True'call a2...
回复

使用道具 举报

千问 | 2009-7-2 12:01:03 | 显示全部楼层
添加一个Timer,取名为TimerHotKeyPrivate Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As IntegerPrivate Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds A...
回复

使用道具 举报

千问 | 2009-7-2 12:01:03 | 显示全部楼层
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)Print "鼠标按下"End SubPrivate Sub Command1_MouseUp(Button As Integer, Shift As Int...
回复

使用道具 举报

千问 | 2009-7-2 12:01:03 | 显示全部楼层
窗体上按F2试试看Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyF2 Then
Print "按下f2"'按下执行一个操作,具体什么自己换成对应的
End IfEnd SubPrivat...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行