|
Well, I don't know about the date picker or anything, but if you're trying to do this with a simple textbox, you have several options. You could use two textboxes, like this:
[ ] : [ ]
And set the max length on both textboxes to two characters. In the keypress event, make it so that they can only enter numbers. Then, in the button or wherever you're validating the time, just check if the first textbox is greater than 0 and less than 13. In the second textbox, check to see if it's simply less than 60. If the time is valid, then combine the text in both textboxes, but put a colon between them.
If you're going to use one textbox, set the max length to 4, and then allow them to only enter numbers and also a colon. Then, when validating the time, check if a colon exists, and if that's the case, that there is only one colon. If this is true, then check to see if the numbers on the left side of the colon are valid, and the numbers on the right.
I don't know anything about the dtpicker so good luck if you go that route.
|