Here is my code.
private void Total_Amount_KeyDown(object sender, KeyEventArgs e)
{
try
{
double a = Convert.ToDouble(txtOldAmt.Text);
double b = Convert.ToDouble(txtDeposit_Amt.Text);
txtTotal.Text = (a + b).ToString();
}
catch (Exception)
{
MessageBox.Show("Invalid input");
}
}