hello!
i have this code
Private Sub rb_W_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rb_W.CheckedChanged
Dim opt As Integer, d As Integer
opt = Int(Me.TXT_r.Text) - 110
If Me.TXT_v.Text = opt Then
Me.lbl_res.Text = ("Excellent")
End If
If Me.TXT_v.Text < opt Then
d = opt - Me.TXT_v.Text
Me.lbl_res.Text = ("Not at all")
Me.TXT_kg.Text = (d)
Else
d = Me.TXT_v.Text - opt
Me.lbl_res.Text = ("You need in")
Me.TXT_kg.Text = (d)
End If
End Sub
It calculate all right.
But by click button "Clear", when debuger reach this line
Me.rb_W.Checked = False 'where rb_W - radiobutton
occure error
Unprocessed exception of type "System.InvalidCastException" occered in Microsoft.visualbasic.dll
conversion of line "" to type Double is invalid.
and VB is pointing on
opt = Int(Me.TXT_r.Text) - 110
What's wrong?