Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

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);
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #validate #preview #input #number #wpf
ADD COMMENT
Topic
Name
8+3 =