private void txtTestPerson_KeyPress(object sender, KeyPressEventArgs e)
{ if ((e.KeyChar >= 'a' && e.KeyChar <= 'z') || (e.KeyChar >= 'A' && e.KeyChar <= 'Z') || e.KeyChar == '\b')
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}

winform中TextBox只能输入字母-LMLPHP

05-03 23:23