Here Mudassar Khan has explained with an example, how to implement decimal number validation in Windows Forms (WinForms) Application using C# and VB.Net.
When the Button is clicked, the TextBox will be validated using Regular Expression (Regex) in C# and VB.Net.
In this article following validation will be performed.
1. Regular Expressions (Regex) to match number with decimal precision of exact 1 decimal place.
2. Regular Expressions (Regex) to match number with decimal precision of exact 2 decimal places.
3. Regular Expressions (Regex) to match number with decimal precision of up to 2 decimal places.
↧