c#数字判断.......
把下列代码添加在文本框的keypress事件中就OK!
if (Char.IsDigit(e.KeyChar) == true || e.KeyChar == 8)
{
e.Handled = false;
}
else
{
e.Handled = true;
}
if (Char.IsDigit(e.KeyChar) == true || e.KeyChar == 8)
{
e.Handled = false;
}
else
{
e.Handled = true;
}
http://u.huoban001.com/space.php