c#编辑框只接受数字 textbox中只输入数字:事件keypress,if (e.KeyChar >= 31 && (e.KeyChar < '0' || e.KeyChar > '9')) {e.Handled = true; }