Validate numeric textbox using int.tryparse visual C#.NET
You could do the same thing with a regular expression:if (Regex.Replace(textBox1.Text, @"\D", "") == textBox1.Text){textBox2.Text = ("tryparse method succeed");} else { textBox2.Text=("value entered is not numeric"); }
You could do the same thing with a regular expression:
if (Regex.Replace(textBox1.Text, @"\D", "") == textBox1.Text)
{
textBox2.Text = ("tryparse method succeed");
} else { textBox2.Text=("value entered is not numeric"); }