Validating event net
Microsoft Foundation Classes (MFC) includes these types of Text Box controls, such as the Edit control, but the MFC numerical Edit control takes the simplistic and less useful interpretation of this requirement to mean that you can enter only the characters 0 through 9 into the textbox.The MFC controls don't let you enter numbers such as 1.25 or -12 if you need to. NET lacks an equivalent to the MFC numerical Edit control, but it does have rich support for inheritance with regard to Windows Forms Controls.
This kind of control should also provide real-time feedback indicating whether the text is valid as the user enters it.
The built-in method is fine for cases where validating user input is not purely structural in nature.
Validation is a good candidate for encapsulation in a self-validating control if the input is independent of the rest of your application's state.
Don't be concerned if you're not familiar with regular expressions.
The regular expressions used in this article aren't complex, and I'll explain everything you need to know to implement them in the validation control.
The first step is to create a base class that serves as the foundation control.