[HELP] Hotkeys
What I would like this code to do is to when I press "F6" Say what is in "Textbox.1" and When I press "F7" it stops
Code:
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

