摘要: 假设文本框只允许输入数字、小数点与退格和回车键,则:方法一:文本框1(TextBox1的KeyPress事件)的代码:private void textBox1_KeyPress(object sender, KeyPressEventArgs e) { //阻止从键盘输入键 e.Handled = true; //当输入为0-9的数字、小数点、回车和退格键时不阻止 if (e.KeyChar >= '0' && e.KeyChar <= '9' || e.KeyChar == '.' || e.KeyChar == 阅读全文
posted @ 2012-03-20 14:31 樹 阅读(937) 评论(0) 推荐(0) 编辑