//只允许输入数字 private void SetKeyChar(KeyPressEventArgs e) { if (e.KeyChar == '-' || Char.IsDigit(e.KeyChar) == false) { if (e.KeyChar != '') { e.Handled = true; } } }
//只允许输入数字 private void SetKeyChar(KeyPressEventArgs e) { if (e.KeyChar == '-' || Char.IsDigit(e.KeyChar) == false) { if (e.KeyChar != '') { e.Handled = true; } } }