文本框 只输入数字键和删除键

private void txtLXDH_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = true;
            int input = Convert.ToInt32(e.KeyChar);
            if ((input <= 57 && input >= 48) || input == 8)
            {
                e.Handled = false;
            }
        }


相关文章:

  • 2021-10-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-28
  • 2021-06-15
  • 2021-07-08
  • 2022-12-23
  • 2022-03-09
相关资源
相似解决方案