austenr
03-09-2010, 08:43 PM
Im using the following sub in a form to calculate the calories burned based on the number of miles ran which is input by the user in a text box.
Problem is, when the button is clicked, the label that is supposed to display the calories burned returns zero and the text box where the user enters the number of miles they ran turns to zero.
Private Sub btnCalories_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalories.Click
Dim decMilesRan As Decimal
Const _cdecCaloriesBurnedPerHour As Decimal = 700D
txtMilesRan.Text = Convert.ToDecimal(decMilesRan)
lblCaloriesBurned.text = _cdecCaloriesBurnedPerHour * decMilesRan
End Sub
Probably something simple but I am not seeing it.
Problem is, when the button is clicked, the label that is supposed to display the calories burned returns zero and the text box where the user enters the number of miles they ran turns to zero.
Private Sub btnCalories_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalories.Click
Dim decMilesRan As Decimal
Const _cdecCaloriesBurnedPerHour As Decimal = 700D
txtMilesRan.Text = Convert.ToDecimal(decMilesRan)
lblCaloriesBurned.text = _cdecCaloriesBurnedPerHour * decMilesRan
End Sub
Probably something simple but I am not seeing it.