If I modify you code, this should work:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace Add
{
public partial class calci : Form
{
public calci()
{
InitializeComponent();
}
private void But_Add_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(Txt_1.Text );
int b = Convert.ToInt32(Txt_2.Text);
int c = a + b;
Ans.Text = c.ToString();
}
}
}
Only change you need to do is:
1) check if numbers are not input and throw exception
2) convert added numbers to string to assign to textbox. I would like to take third variable 'c' to make this look good.