I like to use regular expression validation. That is simple.
You only need to use:
Code:
using System.Text.RegularExpressions |
For the numeric value validation:
Code:
Regex regex = new Regex(@"^[0-9]*$"); | |
if (!regex.IsMatch(textBox1.Text)) | |
{ | |
MessageBox.Show("Invalid value, integer only!"); | |
} |
Recent comments