Methoun Ahmed

Methoun Ahmed

  • 1.9k
  • 145
  • 62.1k

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)