Imports System.Text
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
Form2.Show()
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If GetAsyncKeyState(Keys.F6) Then
Timer1.Enabled = True
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If GetAsyncKeyState(Keys.F7) Then
Timer1.Enabled = False
End If
End Sub
End Class
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
Dim f6 As Boolean
Dim f7 As Boolean
f6 = GetAsyncKeyState(Keys.F6)
If f6 = True Then
timer1.enabled = true
End If
f7 = GetAsyncKeyState(Keys.F7)
If f7 = True Then
timer1.enabled = false
End If
Public Class Form1
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
SendKeys.Send(TextBox1.Text)
SendKeys.Send("{Enter}")
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim f6 As Boolean
Dim f7 As Boolean
f6 = GetAsyncKeyState(Keys.F6)
If f6 = True Then
Timer1.Enabled = True
End If
f7 = GetAsyncKeyState(Keys.F7)
If f7 = True Then
Timer1.Enabled = False
End If
End Sub
End Class

