Entrées-sorties

lldavy - 2 nov. 2000 à 20:26
 int19h - 3 nov. 2000 à 11:59
J'ai envie de tester une donnée entrée au clavier afin de vérifier si c'est un nombre entier.
Merci de bien vouloir m'aider

1 réponse

On lit le contenu d'une TextBox.

Le teste est fait lorsqu'on appuie sur la touche <entrée>.

Private Sub Text1_KeyPress(KeyAscii As Integer)

If KeyAscii = 13 Then
If Text1.Text = "" Then Exit Sub
If Val(Text1.Text) = Int(Val(Text1.Text)) Then
MsgBox "Nombre entier"
End If
End If

End Sub

Ca repond a ta question?
0
Rejoignez-nous