So i'm making a self grading aptitude test that is done except for, if I backspace the entire field of a textbox to be empty is errors out and closes, not upon pressing but upon clearing all the characters. I've been reading some documentation and have had a hard time finding a proper way to implement some way to handle this error. the message after crashing is: This exception was originally thrown at this call stack:
private void AA3_TextChanged(object sender, EventArgs e)
{
int A3 = Int32.Parse(AA3.Text);
if (A3 == 14200)
{
percent +=1;
exp.Text = percent.ToString();
}
}
the code inside is just a counter for the grade at the end, but i am lost why some backspace is okay but not a clear field. Sorry if this is poorly worded.