如下代码即可.在textbox的keypress里边加入如下代码: private void textBox1_KeyPress(object sender, KeyPressEventArgs e) 相关文章: