A1METALHEAD
Programmer
i am creating my first app in c#. and i have a edit box. i want to assign it to a int, how can i make shure that it dosent try to convert it if the edit box has somthing other than numbers. i am a c++ programer, and i already tryed
try
{
num = int.Parse(textBox1.Text);
}
catch (InvalidDataException)
{
return;
}
and it still comes up with an error, could you pleas help?
try
{
num = int.Parse(textBox1.Text);
}
catch (InvalidDataException)
{
return;
}
and it still comes up with an error, could you pleas help?