bool isvalid;
int number;
isvalid = int.TryParse(textBox1.Text,out number);
if (isvalid)
{
MessageBox.Show("Number");
}
if (isvalid == false)
{
MessageBox.Show("Not a number");
}
No comments:
Post a Comment