Input string was not in a correct format.

JackBOYJackBOY NOMember

I get this error code...
here is the code:
int Ctemp;
int newCtemp;
partial void C_TouchUpInside(UIButton sender)
{
TextBox2.Text = "";
TextBox1.Text = "";
Ctemp = int.Parse(TextBox1.Text);
newCtemp = Ctemp * 9/5 +32;
TextBox2.Text += newCtemp;
}

Answers

  • DaveHuntDaveHunt USMember ✭✭✭✭✭

    An empty string is not a valid format for int.Parse(). Why are you setting TextBox1.Text to an empty string and then trying to parse it as an integer anyway?

Sign In or Register to comment.