.net c# text box date with mask - setup

Posted by flavour404 on Stack Overflow See other posts from Stack Overflow or by flavour404
Published on 2010-05-20T00:48:13Z Indexed on 2010/05/20 0:50 UTC
Read the original article Hit count: 299

Filed under:
|
|

I have a c# .net project and want an input text box for a date value. I want it to display a default value of mm/dd/yyyy and then allow users to enter valid dates. I have tried using a masked text box but it doesn't like having the above format. If i try and use //__ looks naff and so does 00/00/0000 and of course if you put in '0' like 03/11/2009 you get 3/11/29 because the 0's are deleted as part of the mask - so what is the best way to set up an input box like this, effectively with a mask, only allowing numbers, and validation (though at this point I am not so worried about that).

This seems so simple and isn't.

Thanks, R.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET