12.4
and
17.6
are not valid
Integer
s. You should use a
Double
. You could use
Convert.ToDouble
to convert the input to a
Double
, but it is a lot better to use
Double.TryParse
to check whether the given input is valid:
Dim first As Double
Dim second As Double
Dim third As Double
If Double.TryParse(txtscore1.Text, first) AndAlso Double.TryParse(txtscore2.Text, second) AndAlso Double.TryParse(txtscore3.Text, third) Then
Dim sum As Double = first + second + third
lbltotalscore.Text = sum.ToString()
Else
End If