Public Class frmCar
Private Sub btnCalc_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim sngMileage As Single
Dim sngRate As Single
Dim sngTotal As Single
'declaring the variables.
sngMileage = CSng(txtMileage.Text)
sngRate = CSng(txtRate.Text)
sngTotal = CSng(txtTotal.Text)
'formating the Total price for the destenation.
txtTotal.Text = Format(sngTotal, "#0.00")
'calculating the total.
txtTotal.Text = CStr(sngTotal)
txtTotal.Text = CStr(sngMileage * sngRate)
End Sub
This post has been edited by BenignDesign: 27 December 2012 - 07:08 AM
Reason for edit:: added [code][/code] tags

New Topic/Question
Reply



MultiQuote





|