private void txtQuantity_KeyPress(object sender, KeyPressEventArgs e)
{
if (char.IsDigit(e.KeyChar) == false && char.IsControl(e.KeyChar) == false)
{
MessageBox.Show("You can enter only number.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtQuantity.Clear();
txtQuantity.Focus();
e.Handled = true;
}
}
{
if (char.IsDigit(e.KeyChar) == false && char.IsControl(e.KeyChar) == false)
{
MessageBox.Show("You can enter only number.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
txtQuantity.Clear();
txtQuantity.Focus();
e.Handled = true;
}
}
No comments:
Post a Comment