For Each caracter As Char In txtrut.Text If Not Char.IsNumber(caracter) Then MessageBox.Show("El rut solo acepta numeros ") Exit Sub End If Next