Home All Groups Group Topic Archive Search About

how to control/check Date datatype inputs in textobx?

Author
31 Jul 2006 10:23 PM
Rich
Hello,

I have been adding a handler to the TextBox.Leave event to check if a value
that is entered in a Date Textbox is a Date.   This works OK.  But I am just
checking if there is anything built-In to VB2005 that does this.  I have
already discovered several goodies that I had not previously been taking
advantage of. 

Is there anything built-in to handle Date datatype checking for controls?

Thanks,
Rich

Author
1 Aug 2006 3:10 PM
Claes Bergefall
Depends on how you define built-in I suppose

There is DateTime.Parse, DateTime.TryParse, DateTime.ParseExact and
DateTime.TryParseExact that you can use to convert a string to a date. If by
built-in you mean something like a DateTextBox, then no, there is no such
control. The closest would be DateTimePicker

   /claes

Show quoteHide quote
"Rich" <R***@discussions.microsoft.com> wrote in message
news:7336B0B3-3608-472C-8C19-7F4C0993BACB@microsoft.com...
> Hello,
>
> I have been adding a handler to the TextBox.Leave event to check if a
> value
> that is entered in a Date Textbox is a Date.   This works OK.  But I am
> just
> checking if there is anything built-In to VB2005 that does this.  I have
> already discovered several goodies that I had not previously been taking
> advantage of.
>
> Is there anything built-in to handle Date datatype checking for controls?
>
> Thanks,
> Rich
>
>