-
Feb 3rd, 2012, 12:29 PM
#1
Thread Starter
Member
A date only texbox
How do I make a textbox control to accept dates only and convert to a valid date format? I don't want to use the calander control.
e.g.
if I enter 2/17 or 2-17 or 02/17 or 2/17/2012; it will convert to
2/17/2012
thank you
-
Feb 3rd, 2012, 01:06 PM
#2
Hyperactive Member
Re: A date only texbox
If you use the Short format for the DateTimePicker control it will only show the date, not the full calendar. Also set ShowUpDown = True to use up/down arrows instead of the calendar.
Last edited by dkahn; Feb 3rd, 2012 at 01:11 PM.
-
Feb 3rd, 2012, 01:13 PM
#3
Thread Starter
Member
Re: A date only texbox
I do not want to use date/time control at all. I want to have a text box and have flexibility to enter dates in many different ways.
2/17 or 2-17 or 02/17 or 2/17/2012; it will convert to
2/17/2012
-
Feb 3rd, 2012, 04:11 PM
#4
Thread Starter
Member
-
Feb 4th, 2012, 12:41 AM
#5
Re: A date only texbox
Originally Posted by mquamar
I do not want to use date/time control at all. I want to have a text box and have flexibility to enter dates in many different ways.
2/17 or 2-17 or 02/17 or 2/17/2012; it will convert to
2/17/2012
Here are some resources to work thru your problem. Consider creating a class which uses IExtenderProvider Interface (see link below)
References
Standard Date and Time Format Strings
Custom Date and Time Format Strings
IExtenderProvider Interface
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|