Thursday, October 27, 2016

Calculator


CODES HERE

Private Sub lblDisplay_Click()

If lblDisplay.Caption = "ADDITION" Then
txtResult.Text = Val(txtFN.Text) + Val(txtSN)

ElseIf lblDisplay.Caption = "DIVISION" Then
txtResult.Text = Val(txtFN.Text) / Val(txtSN)

ElseIf lblDisplay.Caption = "MULTIPLICATION" Then
txtResult.Text = Val(txtFN.Text) * Val(txtSN)

ElseIf lblDisplay.Caption = "SUBTRACTION" Then
txtResult.Text = Val(txtFN.Text) - Val(txtSN)

End If

Private Sub optAdd_Click()
lblDisplay.Caption = "ADDITION"
End Sub

Option buttons codes:

Private Sub optDiv_Click()
lblDisplay.Caption = "DIVISION"
End Sub

Private Sub optMul_Click()
lblDisplay.Caption = "MULTIPLICATION"
End Sub

Private Sub optSub_Click()
lblDisplay.Caption = "SUBTRACTION"
End Sub

FOLLOW US

YOUTUBE CHANNEL: http://www.youtube.com/user/MrJomarflores123

OFFICIAL WEBSITE: https://jstechtutor.blogspot.com/

No comments:

Post a Comment