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