Código:
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub TextBox1_TextChanged() Handles TextBox1.TextChanged Dim TextBox1 As Integer 'Esto TextBox1 = TextBox1 End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If Button1.Enabled = True Then CheckBox1.Enabled = True End If AppActivate("Bloc de notas") 'Finds the window NOTEPAD End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click If Button2.Enabled = True Then CheckBox1.Enabled = False End If AppActivate("Bloc de notas") 'Finds the window NOTEPAD End Sub Private Sub CheckBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.Click If CheckBox1.Enabled = True Then Dim TextBox1 As Integer 'Esto TextBox1 = TextBox1 Timer1.Interval = TextBox1 + 1 ' it is 1 sek, for 50 ms must be 50 Else CheckBox1.Enabled = False End If If CheckBox1.Enabled = True Then Dim TextBox1 As Integer 'Esto TextBox1 = TextBox1 Timer2.Interval = TextBox1 + 50 ' it is 1 sek, for 50 ms must be 50 Else CheckBox1.Enabled = False End If If CheckBox1.Enabled = True Then Dim TextBox1 As Integer 'Esto TextBox1 = TextBox1 Timer3.Interval = TextBox1 + 100 ' it is 1 sek, for 50 ms must be 50 Else CheckBox1.Enabled = False End If AppActivate("Bloc de notas") 'Finds the window NOTEPAD End Sub Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick If CheckBox1.Enabled = True Then SendKeys.Send("d") ' Envia Scape Else Timer1.Enabled = False End If End Sub Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick If CheckBox1.Enabled = True Then SendKeys.Send("s") ' Envia Right Arrow Else Timer2.Enabled = False End If End Sub Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick If CheckBox1.Enabled = True Then SendKeys.Send("f") ' Envia Enter Else Timer3.Enabled = False End If End Sub End Class