Methoun Ahmed

Methoun Ahmed

  • NA
  • 145
  • 101.7k

Keydown Event not working properly

Sep 27 2017 4:01 AM
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");
}
}

 

Answers (10)