//判断是否是数字
1 if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (e.KeyChar != 46) && (e.KeyChar != 127)) 2 { 3 e.Handled = true; 4 }
//判断是否是数字
1 if ((e.KeyChar < 48 || e.KeyChar > 57) && (e.KeyChar != 8) && (e.KeyChar != 46) && (e.KeyChar != 127)) 2 { 3 e.Handled = true; 4 }
转载于:https://www.cnblogs.com/cynthia0706/p/9365693.html