C maskedtextbox validating
Managing date information within the framework (or any framework, really . Please feel free to fork, and if you make happy improvements, hit me with a pull request. Do we really want to require some date, if we don’t know the correct birthdate? Folks who are good, tab through fields, and enter data. Not to mention the temptation to stop the tab-type-tab workflow by making you pick from a popup calendar. MS seems to have tossed this aside, and delivered the lame control we have at our disposal in the . There are probably reasons for this, but I don’t know what they are.
The complete source code for this project (with a silly demo) is available on Github as a VS 2010 solution. For example, in entering form data for a person, we may or may not know their Date of Birth. While there are hacks and workarounds for this, most require some sort of painful validation checking in our code Never mind that the Date Time Picker is not the preferred data-entry choice for people who know how to tab through fields. Once upon a time, way back in MS Access, there existed a decent masking approach for entering date values into a textbox.
That said, it would be a small issue to adapt the code to utilize a different date format.
I didn’t have time to build in the kind of flexibility which would allow the mask, and the required validations and text manipulations, to be variable.
For the purposes of my project, I have achieved these requirements.
The control has flaws to this point, in terms of general use (limiting the acceptable centuries comes immediately to mind), but it is a starting point.
If that isn’t bad enough, there is a definite data type mismatch between the manner in which the framework represents date information, and the way relational databases handle dates.
What makes it even worse is managing user data entry of date information.