oui ben voila tout le code:
Public op As String
Public neg As String
Public ind As Boolean
Public tampon As String
Public rest As Boolean
Private Sub addition_Click()
op = "+"
ind = True
rest = True
End Sub
Private Sub Command2_Click()
op = "-"
ind = True
resultat.Text = "-" & resultat.Text
End Sub
Private Sub egal_Click()
If (op = "+") Then
resultat.Text = Val(tampon) + Val(resultat.Text)
ElseIf (op = "-") Then
resultat.Text = tampon - resultat.Text
ElseIf (op = "*") Then
resultat.Text = tampon * resultat.Text
ElseIf (op = "/") And resultat.Text <> 0 Then
resultat.Text = tampon / resultat.Text
Else: resultat.Text = "erreur"
End If
End Sub
Private Sub Form_Load()
ind = False
rest = False
End Sub
Private Sub nb10_Click()
neg = "-"
resultat.Text = "-" & resultat.Text
End Sub
Private Sub ress_Click()
ress = "0"
resultat.Text = "0"
End Sub
Private Sub soustraction_Click()
op = "-"
ind = True
rest = True
End Sub
Private Sub division_Click()
op = "/"
ind = True
rest = True
End Sub
Private Sub multiplication_Click()
op = "*"
ind = True
rest = True
End Sub
Private Sub nb0_Click()
If ind = True Then
tampon = resultat.Text
resultat.Text = "0"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "0"
Else
resultat.Text = resultat.Text & "0"
End If
End Sub
Private Sub nb1_Click()
If (ind = True) Then
tampon = resultat.Text
resultat.Text = "1"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "1"
Else
resultat.Text = resultat.Text & "1"
End If
End Sub
Private Sub nb2_Click()
If (ind = True) Then
tampon = resultat.Text
resultat.Text = "2"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "2"
Else
resultat.Text = resultat.Text & "2"
End If
End Sub
Private Sub nb3_Click()
If ind = True Then
tampon = resultat.Text
resultat.Text = "3"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "3"
Else
resultat.Text = resultat.Text & "3"
End If
End Sub
Private Sub nb4_Click()
If ind = True Then
tampon = resultat.Text
resultat.Text = "4"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "4"
Else
resultat.Text = resultat.Text & "4"
End If
End Sub
Private Sub nb5_Click()
If ind = True Then
tampon = resultat.Text
resultat.Text = "5"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "5"
Else
resultat.Text = resultat.Text & "5"
End If
End Sub
Private Sub nb6_Click()
If ind = True Then
tampon = resultat.Text
resultat.Text = "6"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "6"
Else
resultat.Text = resultat.Text & "6"
End If
End Sub
Private Sub nb7_Click()
If ind = True Then
tampon = resultat.Text
resultat.Text = "7"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "7"
Else
resultat.Text = resultat.Text & "7"
End If
End Sub
Private Sub nb8_Click()
If ind = True Then
tampon = resultat.Text
resultat.Text = "8"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "8"
Else
resultat.Text = resultat.Text & "8"
End If
End Sub
Private Sub nb9_Click()
If ind = True Then
tampon = resultat.Text
resultat.Text = "9"
ind = False
ElseIf resultat.Text = "0" Then
resultat.Text = "9"
Else
resultat.Text = resultat.Text & "9"
End If
End Sub
Private Sub virgule_Click()
resultat.Text = resultat.Text & ","
End Sub
pas mal d'erreur je suppose
Peace And Love!!!