实例:(禁止客户输入非字母或非数字)
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (!char.IsLetterOrDigit(e.KeyChar))
{
e.Handled = true;
}
}
注:
char中还有判断:小写字母,大写字母,数字等方法。
判断文本框中输入的(禁止客户输入非字母或非数字)
最新推荐文章于 2021-02-12 10:55:31 发布