Condition pour saisir un entier

ayoubenim Messages postés 9 Date d'inscription lundi 6 septembre 2010 Statut Membre Dernière intervention 18 octobre 2010 - 6 sept. 2010 à 18:18
nathansecret Messages postés 63 Date d'inscription mardi 11 novembre 2008 Statut Membre Dernière intervention 31 octobre 2011 - 6 oct. 2010 à 19:21
Salut,
je veux mettre une Condition pour saisir un entier dans un text comment aire. merci

2 réponses

NSUADI Messages postés 540 Date d'inscription mardi 4 août 2009 Statut Membre Dernière intervention 1 février 2013 2
6 sept. 2010 à 19:09
Private Sub Text1_Change()
If Not IsNumeric(Text1.Text) Then
Text1.Text = ""
Else
'exécution de ton code
End If
End Sub

Ce qui compte,ce n'est pas ce qu'on a mais plutôt ce que l'on fait avec ce qu'on a...
Visual Basic .Net is the best and vb6.0
0
nathansecret Messages postés 63 Date d'inscription mardi 11 novembre 2008 Statut Membre Dernière intervention 31 octobre 2011
6 oct. 2010 à 19:21
Private Sub Text1_Change()
    On Error Resume Next
    Texte = Text1.text
    Dim Good As Boolean
    For I = 1 to Len(Texte)
        Good = False
        For J = 0 To 9
            If Mid(Texte,i,1) Trim(" " & J) Then Good True
        Next J
        If Good = False Then
            Text1.Text  = ""
            Exit Sub
        End If
    Next I
End Sub

Et voilà...
0
Rejoignez-nous