cs_sensy
Messages postés2Date d'inscriptionlundi 8 décembre 2003StatutMembreDernière intervention25 octobre 2004
-
25 oct. 2004 à 05:53
cs_sensy
Messages postés2Date d'inscriptionlundi 8 décembre 2003StatutMembreDernière intervention25 octobre 2004
-
25 oct. 2004 à 14:32
Slt Slt j'ai un probleme avec VB.NET pour un nombre négatif dans une TextBox.
CODE:
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles aTextBox.TextChanged
If aTextBox.Text = "" Then
ElseIf aTextBox.Text < 0 Then /**il bug là**/
a.Text = aTextBox.Text
ElseIf aTextBox.Text > 0 Then
a.Text = aTextBox.Text
ElseIf aTextBox.Text = 0 Then
a.Text = aTextBox.Text
Else
Call MsgBox("Saisie incorrecte veuillez entrer un nombre" & Chr(13) & "Positif ou Négatif", MsgBoxStyle.OKOnly, "Erreur")
End If
End Sub
ERREUR:
Une exception non gérée du type 'System.InvalidCastException' s'est produite dans microsoft.visualbasic.dll
Informations supplémentaires : Cast de la chaîne "-" en type 'Double' non valide.
---------------------------------------------------------------------------
Existe t'il une fonction du type : IsNumeric qui accepterai les nombre négatif ?