I have to develop a programm for a race that is suppose to put the runners in first, second and third place. Everything works except my calculate button this is my code.Forgive me I am very new to this. Any advice
Code:
Private Sub btncalculate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btncalculate.Click
'Calculate who came in first, second and third place
Dim txtrunner1finish As Single
Dim txtrunner2finish As Single
Dim txtrunner3finish As Single
'Copy the times into the variables
Try
txtrunner1finish = CSng(txtrunner1finish.ToString)
txtrunner2finish = CSng(txtrunner2finish.ToString)
txtrunner3finish = CSng(txtrunner3finish.ToString)
Catch ex As Exception
MessageBox.Show("Time scores must be numeric.", "Error")
Return
End Try
'Calculate and display the winner
If txtrunner1finish < txtrunner2finish < txtrunner3finish Then
lblfirstresults.Text = txtrunner1finish
lblsecondresults.Text = txtrunner2finish
lblthirdresults.Text = txtrunner3finish
End If
End Sub
Comment