如下代码即可.在textbox的keypress里边加入如下代码:

 

控制用户在textbox里只能输入数字private void textBox1_KeyPress(object sender, KeyPressEventArgs e)

相关文章: