Código:
Public Class frmnro2
Dim cont As Integer = 0
Private Sub txt1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txt1.KeyPress
Dim cad As String
Dim n As Integer
If Char.IsNumber(e.KeyChar) = True Then
cont += 1
lbl1.Text = "Numeros ingresados:" & cont
ElseIf (Asc(e.KeyChar) = 8) And (n >= 0) Then
cad = txt1.Text.ToString
n = txt1.SelectionStart()
If (Char.IsNumber(cad(n - 1)) = True) And n >= 0 Then
cont -= 1
lbl1.Text = "Numeros ingresados:" & cont
End If
End If
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt1.TextChanged
End Sub
Private Sub frmnro2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub lbl1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbl1.Click
End Sub
End Class

