按键精灵如何通过一个多选框启动关闭一个多线程中的一个单线程

2025-03-14 10:18:02
推荐回答(1个)
回答1:

代码如下:
Event Form1.CheckBox1.Click
If KeyPressE = "" And Form1.CheckBox1.Value = 1 Then
KeyPressE = BeginThread(KeyPressKey(69, 5000))
Else
StopThread KeyPressE
KeyPressE = ""
End If
End Event
Event Form1.CheckBox2.Click
If KeyPressQ = "" And Form1.CheckBox2.Value = 1 Then
KeyPressQ = BeginThread(KeyPressKey(81, 100))
Else
StopThread KeyPressQ
KeyPressQ = ""
End If
End Event
Sub KeyPressKey(Key, t)
While True
KeyPress Key, 1
Delay t
Wend
End Sub