Regular Expression Validation
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!"); | |
} |
Trackback address for this post
Trackback URL (right click and copy shortcut/link location)
Feedback awaiting moderation
This post has 3159 feedbacks awaiting moderation...
Form is loading...