I am looking at writing a program that presses a key ('A') every minute in whatever the focused window is. I am having trouble working out what command to use in the timer1_timer sub so that it presses A and then restarts the timer, what I have at the moment dosn't work. I am using Visual Basic 2005 Express
Here is the code
Here is the code
Code:
Public Class Form1
'timer enabled on click of start button
Private Sub cmdStart_Click()
Timer1.Enabled = True
End Sub
'timer stopped on click of end button
Private Sub cmdEnd_Click()
Timer1.Enabled = False
End Sub
'send keys is activated every time the timer event occurs
'Restarts the timer
Private Sub Timer1_Timer()
SendKeys.Send("A")
Timer1.Enabled = True
End Sub
Private Sub cmdStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdStart.Click
End Sub
'Creates buble tooltip on mouse hover
Private Sub cmdStart_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdStart.MouseHover
toolTip.SetToolTip(cmdStart, "Click here to start the timer")
End Sub
'Creates bubble tooltip on mouse hover
Private Sub cmdEnd_MouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdEnd.MouseHover
toolTip.SetToolTip(cmdEnd, "Click here to stop the timer")
End Sub
End Class
Comment