📅  最后修改于: 2022-03-11 14:49:08.889000             🧑  作者: Mango
-------------------------------------------------------------------------------
using System.Text.RegularExpressions;
private void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
{
Regex regex = new Regex("[^0-9]+");
e.Handled = regex.IsMatch(e.Text);
}