Code:
PrivateSub chkFabric_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkFabric.CheckedChanged
IfNot IsNumeric(txtPrice.Text) Then
chkFabric.Checked = False
MessageBox.Show("Please Correct the price")
ExitSub
EndIf
addprice()
EndSub
This text box contains a string "20 to 25"
User is expected to correct the price by typing a number between 20 to 25 in the text box. When this sub executes it checks if the user has entered the correct number in the text box. If it is not a numeric data then it forces the user to correct the data in text box.
When this sub executes the messagebox appears twice.
I would appreciate if somebody corrects the code but I would be greatfull they explain me why is it happening.