有时间没到这个版块来了,借你的帖子像大家打个招呼。
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal Scan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_LBUTTON = &H1
Private Const VK_F5 = &H74
Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 200
End Sub
Private Sub Timer1_Timer()
Dim Keys As Long
'判断函数调用时指定虚拟键的状态
Keys = GetAsyncKeyState(VK_LBUTTON)
If Keys < 0 Then
keybd_event VK_F5, 0, 0, 0
End If
End Sub
顺便说一句:VB只是一个小站!