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,
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,
CALCULATOR
"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
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
No comments :
Post a Comment