when i execute it will run but when i press the enter key the message box still appears
for moneytextbox Keydown
if (e.KeyCode == Keys.Enter)
{
int a, b, c;
a = int.Parse(money.Text);
b = int.Parse(bill.Text);
c = a - b;
change.Text = c.ToString();
}
for moneytextboxKeypress
if (!(Char.IsDigit(e.KeyChar) || (e.KeyChar == (char)Keys.Back)))
{
MessageBox.Show("please enter digits only");
e.Handled = true;
}
i tried to unblock the enter key in the keypress event
if (!(Char.IsDigit(e.KeyChar) || (e.KeyChar == (char)Keys.Enter)))
{
MessageBox.Show("please enter digits only"); e.Handled = true;
}
but "message box" still appears