Validating the textbox entry for date format
I would also either go with the validation events, or the TextChanged event to try and parse out the text into a DateTime object. You can cache the text before you try and parse it, and roll back the text to the previous if the parsing fails.
Again, there are a hundred different ways to approach this problem, some may be arguably better than others, but most will get you where you want to go.
Cheers!
Dig Deeper on C# programming language
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.
Meet all of our Microsoft .Net Development experts
Start the conversation
0 comments