basically I have a textbox
Code:Private Sub txt_NumberA_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txt_NumberA.TextChanged Try NumberA = Decimal.Parse(txt_NumberA.Text) Catch ex As Exception MsgBox("This program requires a numeric input. Please try again. Enter .500 as 0.500.") Return End Try NumberB = 5.0 NumberC = NumberB/NumberA lbl_NumberC.Text = NumberC End Sub
I have no problem entering any number that does not start with a zero, however, if I want to enter 0.5 in, then as I type in '0', then I have division by zero and the program crashes.
Could you please help me to fix this? Many thanks,
Nina




Reply With Quote