Blog Post


Biyernes, Marso 6, 2015

Visual Basic 6.0 : Basic Calculator

Sample 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
Watch video below 

0 (mga) komento:

Mag-post ng isang Komento