把开发过程比较好的内容做个记录,下面代码段是关于C#开发windows form限制文本框输入的代码。
private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e)
{
const char Delete = (char)8;
e.Handled = !Char.IsDigit(e.KeyChar) && e.KeyChar != Delete;
}
把开发过程比较好的内容做个记录,下面代码段是关于C#开发windows form限制文本框输入的代码。
private void textBoxInput_KeyPress(object sender, KeyPressEventArgs e)
{
const char Delete = (char)8;
e.Handled = !Char.IsDigit(e.KeyChar) && e.KeyChar != Delete;
}