Answers for "validate preview input number wpf"

C#
0

validate preview input number wpf

using System.Text.RegularExpressions;
private void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
{
    Regex regex = new Regex("[^0-9]+");
    e.Handled = regex.IsMatch(e.Text);
}
Posted by: Guest on August-12-2021

C# Answers by Framework

Browse Popular Code Answers by Language