My Calculator

SCREENSHOT


CODE

Private Sub cmdAdd_Click()
lblAnswer.Caption = Val(txtFn.Text) + Val(txtSn.Text)
End Sub

Private Sub cmdClear_Click()
txtFn.Text = ""
txtSn.Text = ""
lblAnswer = "0.00"
End Sub

Private Sub cmdCon_Click()
lblAnswer.Caption = txtFn.Text + txtSn.Text
End Sub

Private Sub cmdDiv_Click()
lblAnswer.Caption = Val(txtFn.Text) / Val(txtSn.Text)
End Sub

Private Sub cmdExit_Click()
If MsgBox("Are you sure you want to close My Calculator?", vbQuestion + vbYesNo, "Close Applet") = vbYes Then
    End
Else
    txtFn.SetFocus
End If
End Sub

Private Sub cmdExp_Click()
lblAnswer.Caption = Val(txtFn.Text) ^ Val(txtSn.Text)
End Sub

Private Sub cmdInt_Click()
lblAnswer.Caption = Val(txtFn.Text) \ Val(txtSn.Text)
End Sub

Private Sub cmdMod_Click()
lblAnswer.Caption = Val(txtFn.Text) Mod Val(txtSn.Text)
End Sub

Private Sub cmdMul_Click()
lblAnswer.Caption = Val(txtFn.Text) * Val(txtSn.Text)
End Sub

Private Sub cmdSub_Click()
lblAnswer.Caption = Val(txtFn.Text) - Val(txtSn.Text)
End Sub

Private Sub textempty()
If txtFn.Text = "" And txtSn.Text = "" Then
    MsgBox "Empty Fields!", , "Text Empty"
    txtFn.SetFocus
    lblAnswer.Caption = "0.00"
End If
End Sub

Private Sub textnotnum()
If IsNumeric(txtFn.Text) = False Then
    MsgBox "Enter Number Only!", vbInformation, "Validation"
    txtFn.SetFocus
End If
End Sub

Download Full Project Source Code Here: My Calculator
Related Posts Plugin for WordPress, Blogger...

CHATBOX

Translate

Download Installer

Filter Post Here...