Timer1:
Código:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
CheckBox1.checked = true
End Sub
Timer2:
Código:
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
Dim hotkey As Boolean
If TextBox1.Text = "F1" Then
hotkey = GetAsyncKeyState(Keys.F1)
End If
If TextBox1.Text = "F2" Then
hotkey = GetAsyncKeyState(Keys.F2)
End If
If hotkey = True Then
Timer1.Start()
End If
End Sub
Quiero hacer que el Timer1 se active al darle A LA TECLA QUE HAY ESCRITA EN EL TEXTBOX1, y quiero hacer que se puedan poner todas las teclas del teclado, pero sería una matada poner todas las teclas con
Código:
If TextBox1.Text = "F3" Then
hotkey = GetAsyncKeyState(Keys.F3)
End If
Y así seguir F4, F5, F6...
¿Hay alguna manera de que la tecla que introduzca en el Textbox1 sea la hotkey sin tener que escribir todas?
Por ejemplo:
Código:
hotkey = GetAsyncKeyState(Textbox1.text)
End If
pero eso no funciona, ¿es posible hacer lo que quiero?
gracias de antebrazo