namespace tryparse
{
public partial class Form1: Form
{
public Form1()
{
initialize component();
}
private void button_Click(object sender , EventArgs e)
{
int i,j;
bool a1 =int.TryParse(textBox.Text , out i);
bool a2=int.TryParse(textBox.Text , out i);
if(a1== true && a2==true)
{
int b = i+j;
MessageBox.Show(b.ToString());
}
else
MessageBox.Show("Enter numeric values only");
}
}