tt
Private Sub cmdcalculate_Click()
Rem make decision on the city chosen
If cbocity.ListIndex = 1 Then tax = 0.07 * txtprice
If cbocity.ListIndex = 2 Then tax = 0.08 * txtprice
If cbocity.ListIndex = 3 Then tax = 0 * txtprice
If cbocity.ListIndex = 4 Then tax = 0.06 * txtprice
Rem make calculations and display
lblcity = cbocity
Rem make calculation
lblgst = 0.07 * txtprice
lbltax = tax
lbltotalprice = Val(txtprice) + lblgst + lbltax
Rem diplay GST and provincial sales tax and total price to label in currency format
lblgst = Format$(lblgst, "currency")
lbltax = Format$(lbltax, "currency")
lbltotalprice = Format$(lbltotalprice, "currency")
End Sub


Sub resultCalc()
If optadd = True Then result = Val(txtfirst) + Val(txtsecond)
If optsubtract = True Then result = Val(txtfirst) - Val(txtsecond)
If optmultiply = True Then result = txtfirst * txtsecond
If optdivide = True Then result = txtfirst / txtsecond
If optexponent = True Then result = txtfirst ^ txtsecond
End Sub
Sub displayProvname()
Rem display information to the picture box
Provname = Format$(Provname, "0.00")
pic1.Print txtfirst
pic1.Print txtsecond
pic1.Print Provname
End Sub
Sub ChooseProv()
Rem make decison on the province
If optadd = True Then
result = Val(txtfirst) + Val(txtsecond)
Provname = "Add"
End If
If optsubtract = True Then
result = Val(txtfirst) - Val(txtsecond)
Provname = "Subtract"
End If
If optmultiply = True Then
result = txtfirst * txtsecond
Provname = "Multiply"
End If
If optdivide = True Then
result = txtfirst / txtsecond
Provname = "Divide"
End If
If optexponent = True Then
result = txtfirst ^ txtsecond
Provname = "Exponent"
End If
End Sub
Private Sub cmdcalculate_Click()
Call ChooseProv
Call resultCalc
Call displayProvname
Rem make calculation
lblresult = result
End Sub
Private Sub cmdexit_Click()
Rem to end this program
End
End Sub