I'm experimenting with a simple auto typer. I've made several of these before, but have never received this error. I just want to be able to send the text within textbox3 to the currently focused window. Here's the code :
code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If Timer1.Enabled = False Then
Timer1.Enabled = True
Button2.Text = "Stop"
ElseIf Timer1.Enabled = True Then
Timer1.Enabled = False
Button2.Text = "Send"
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If CheckBox1.Checked = True Then
SendKeys.Send("{ENTER}")
SendKeys.Send(TextBox3.Text)
ElseIf CheckBox1.Checked = False Then
SendKeys.Send(TextBox3.Text)
End If
End Sub
Private Sub NumericUpDown1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NumericUpDown1.ValueChanged
Timer1.Interval = NumericUpDown1.Value
End Sub
Thats the only portion involving the sendkeys method and timer. Some of the text within textbox3 comes from variables as well, if that helps to know.