dim i as integer Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)'这个是用来检验的 If KeyCode = vbKeyF5 Then Print "hh" End Sub Private Sub Form_Load() Timer1.Interval = 60000'一分钟定时 End Sub Private Sub Timer1_Timer() i=i+1 if i=5 then '五分钟定时 SendKeys "{F5}" i=0 end if End Sub '这个程序是对Form1也就是自己建立的窗口,执行按F5的 '如果要对其他程序按F5,比方说是计算机,那就在sendkeys上面加这段代码 'ReturnValue = Shell("CALC.EXE", 1) ' 运行计算器。 'AppActivate ReturnValue ' 激活计算器。