private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar > 0 && e.KeyChar < 7) || (e.KeyChar > 9 && e.KeyChar < 177))
{
e.Handled = true;
MessageBox.Show("姓名只能输入汉字");
}
}
来自王绚文老师博客
2024-02-29 18:19:10
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if ((e.KeyChar > 0 && e.KeyChar < 7) || (e.KeyChar > 9 && e.KeyChar < 177))
{
e.Handled = true;
MessageBox.Show("姓名只能输入汉字");
}
}
来自王绚文老师博客
下一篇:T-SQL 存储过程