(I am using Visual C#)
I need to determine if a string has a number. If it contains a number. An error message must show saying that it is invalid. That letters are only accepted..
I have this code:
txtFirst.Text = "981298ABCD";
if (int.TryParse(txtFirst.Text, out input))
{
MessageBox.Show("Invalid");
}
else
{
MessageBox.Show("Letters");
}
Now, with that, it works ok.. but when the Letters are first entered..
txtFirst.Text = "ABCD1223";
if (int.TryParse(txtFirst.Text, out input))
{
MessageBox.Show("Invalid");
}
else
{
MessageBox.Show("Letters");
}
It proceed with the else statement.. How can I say it is invalid too?
I need advice. Thank you so much..

New Topic/Question
Reply



MultiQuote





|