bueno mi duda ahora es la validacion de texto, siempre he validado numeros, pero nunca texto, trate con if not isnumeric(....text) pero no me funciona por que si coloco Nombre4 me lo pasa sin error.
como valido texto, que solo sea de la a-z. gracias.
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If (Not e.KeyChar Like "[a-z]") And (Asc(e.KeyChar) < 8 Or Asc(e.KeyChar) > 32) Then MsgBox("Ingrese únicamente letras minusculas.", MsgBoxStyle.Exclamation) e.Handled = Not (e.KeyChar = "0") End If End Sub
o de esta otra manera q es igual
Código:
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress If (Asc(e.KeyChar) < 97 Or Asc(e.KeyChar) > 122) And (Asc(e.KeyChar) < 8 Or Asc(e.KeyChar) > 32) Then MsgBox("Ingrese únicamente letras minusculas.", MsgBoxStyle.Exclamation) e.Handled = Not (e.KeyChar = "0") End If End Sub