Hola, estoy haciendo un programa en Visual Basic 2008, que al darle a la tecla F2 por ejemplo se activa el Timer1, aquí os voy a dejar un poco de código para explicar mejor:
Timer1:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
CheckBox1.checked = true
End Sub
Timer2:
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
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:
hotkey = GetAsyncKeyState(Textbox1.text)
End If
pero eso no funciona, ¿es posible hacer lo que quiero?
gracias de antebrazo
esto no es .net?
HOLA!!!
Esto va en Net (http://foro.elhacker.net/net-b62.0/)
Reportado
GRACIAS POR LEER!!!