Private Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged'l'ors de la saisie sur le textbox If IsNumeric(TextBox2.Text) Then Instruction's'il est numerique vous continuez si non un message s'affiche Else MsgBox("tatatatatat", MsgBoxStyle.Information, "Information") End If End Sub
Sujets en rapport avec ce message
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub TextBox2_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox2.TextChanged'l'ors de la saisie sur le textbox If IsNumeric(TextBox2.Text) Then Instruction's'il est numerique vous continuez si non un message s'affiche Else MsgBox("tatatatatat", MsgBoxStyle.Information, "Information") TextBox2.Text="" TextBox2.focus() End If End Sub
Donc la bonne solution reste de tester la frappe, et non le texte rentrée.
interdire la saisie d'un caractère d'un champ textbox
sauf les chiffres