求教
让电脑3秒自动单击一下数字键5(不是小键盘)怎么做啊,本人新手摆脱了 --------------------编程问答-------------------- Sleep 3000CreateObject("WScript.Shell").SendKeys "5" --------------------编程问答-------------------- Sleep是API函数,在代码页顶端加入这句话来声明:
Private Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long) --------------------编程问答-------------------- 用timer控件,代码
Private Sub Form_Load()
Timer1.Interval = 3000
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
CreateObject("WScript.Shell").SendKeys "5"
End Sub
--------------------编程问答--------------------
'添加定时器控件窗体,然后复制以下代码,运行程序后,你打开记事本等一会看看,有5吗?
Private Sub Form_Load()
Timer1.Interval = 3000
Form1.WindowState = 1
End Sub
Private Sub Timer1_Timer()
SendKeys 5, False
End Sub
补充:VB , 基础类