Hola, tengo un problemilla, tengo un evento Keypress con un Textbox y un Boton en Visual .Net y resulta que quiero guardar lo que el cliente presione (Solo numeros) en una variable. Luego hacer un acumulador que termine cuando el cliente presione el boton, hize esto pero no me resulta se me queda pegado.
Código:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Dim x As Char
Dim m As Integer
m = 0
Do
x = x + e.KeyChar
MsgBox(x)
If (Button1.Handle = True) Then
m = 1
End If
Loop While (m = 1)
End Sub
Espero de su ayuda...gracias. :D