private void txtPort_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (e.KeyChar != '\b')//允许输入退格键
            {
                if ((e.KeyChar < '0') || (e.KeyChar > '9'))//允许输入0-9数字
                {
                    e.Handled = true;
                }
            }
        }

  

相关文章:

  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-26
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案