📅  最后修改于: 2022-03-11 14:55:27.708000             🧑  作者: Mango
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
e.Handled = !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar);
}