cs_JLuc01
Messages postés206Date d'inscriptionsamedi 17 janvier 2009StatutMembreDernière intervention 5 mars 2013
-
13 févr. 2012 à 22:37
cs_JLuc01
Messages postés206Date d'inscriptionsamedi 17 janvier 2009StatutMembreDernière intervention 5 mars 2013
-
14 févr. 2012 à 09:29
Bonsoir,
Je cherche comment obliger l'utilisateur a introduire des nombres dans un textbox entre 100 et 400 par exemple (VB2008). Je crois que le Regex est bon, mais je n'en suis pas sur du tout.
Private Sub XTextBox_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles XTextBox.Validating
If Me.XTextBox.Text.Length > 0 Then
If Not System.Text.RegularExpressions.Regex.Match(Me.XTextBox.Text, "\d[100-400]").Success Then
e.Cancel = True
End If
End If
End Sub
Quelqu'un peut-il me confirmer ou non si ce Regex est bon?
J'ai des problemes pour faire marcher ce code, mais cela vient peut-etre du code VB (a approfondir).
Pour l'instant, je voudrais savoir si ce Regex est bon.
Merci,