private void txtUserId_KeyPress(object sender, KeyPressEventArgs e)
{
//如果输入的不是数字键,也不是回车键、Backspace键,则取消该输入
if (!(Char.IsNumber(e.KeyChar)) && e.KeyChar!=(char) && e.KeyChar!=(char))
{
e.Handled = true;
}
}
04-15 02:18