bool includesNotOnlyNumeric = Regex.IsMatch(textBox.Text, @"\D"); if (includesNotOnlyNumeric) { // don't show an alert box } else { // show an alert box }
string str = myTextBox.Text; Regex includesNonNumeric = new Regex(@"[^\d]"); if (includesNonNumeric.IsMatch(str)) { // OK } else { // Failed }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)