You are not logged in.
hahay , unfortunately no , maybe in the future
Option Explicit
Dim sum1 As Double
Dim sum2 As Double
Dim sign As String
Private Sub cmdClear_Click()
Form_Load
End Sub
Private Sub cmdDot_Click()
If InStr(1, txtResult, ".") <> 0 Then
MsgBox " , deja ajouté"
Else
txtResult.Text = txtResult.Text & "."
End If
End Sub
Private Sub cmdEnter_Click()
sum2 = txtResult.Text
If sign = "/" Then
sum2 = sum2 / sum1
ElseIf sign = "*" Then
sum2 = sum2 * sum1
ElseIf sign = "-" Then
sum2 = sum2 - sum1
Else
sum2 = sum2 + sum1
End If
txtResult.Text = sum2
End Sub
Private Sub Command1_Click(Index As Integer)
txtResult.Text = txtResult.Text & Command1(Index).Caption
End Sub
Private Sub Command2_Click(Index As Integer)
sum1 = Val(txtResult.Text)
sign = Command2(Index).Caption
txtResult.Text = ""
End Sub
Private Sub Form_Load()
txtResult.Text = ""
sum1 = 0
sum2 = 0
sign = ""
txtResult.Enabled = False
txtResult.MaxLength = 10
End Sub
Last edited by patrick (January 6 2010)
You guys have to admit , that it's impressive for the guy who didn't understand anything !
I would love to thank this website :
If it weren't for him , I would have probably failed my year because of one silly module