求一个VB 快捷键的功能按F12

2025-04-05 17:50:25
推荐回答(1个)
回答1:

呵呵,刚好我前几天写了一个相似的,画个timer
Private Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer
Private Sub Timer1_Timer()
x = GetAsyncKeyState(111 + 12) 'f12
If x = -32767 Then text1.text="的内容为你按了F12"
End Sub
GetAsyncKeyState 参考 http://baike.baidu.com/view/1467704.htm