Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
Dim texto As String = "" 'string que substituirá o texto actual na textbox
For Each c As Char In TextBox1.Text 'percorre todos os caracteres
If Asc(c) <= 57 AndAlso Asc(c) >= 48 Then texto &= c 'se este caractere for um número, adiciona-o à string
Next
Dim posicao As Integer = TextBox1.SelectionStart - (TextBox1.TextLength - texto.Length) 'nova posição do cursor dentro da textbox
TextBox1.Text = texto 'substituir o texto antigo pelo novo, já filtrado
TextBox1.Select(posicao, 0) 'colocar o cursor na devida posição
End Sub