日期:2014-05-17 浏览次数:21056 次
private void textBoxAddWrite_KeyPress(object sender, KeyPressEventArgs e) { if ('0' > e.KeyChar || e.KeyChar > '9')//输入的按键值在‘0’~‘9’之间 { if (e.KeyChar != 8)//不是backspace键 e.KeyChar = (char)0;//设定键值为0 }