-
Nov 8th, 2018, 04:56 AM
#1
Thread Starter
Addicted Member
[RESOLVED] Date should be between 'MinDate' and 'MaxDate' ?
Morning all,
I'm pulling my hair our here, I'm blatently missing something but can't seem to see it...
I'm trying to display a datetime variable in a textbox using:
Public Class cTest
Public Start_Date As DateTime
Public Class TestForm
Textbox1.Text = cTest.Start_Date.ToShortDateString
But I keep getting an Out Of Range Exception Value of '05/09/2018 00:00:00' is not valid for 'Value'. 'Value' should be between 'MinDate' and 'MaxDate'.
The value is well within the minvalue & maxvalue:
Console.WriteLine(Date.MinValue)
01/01/0001 00:00:00
Console.WriteLine(Date.MaxValue)
31/12/9999 23:59:59
Any idea what i'm missing....?
Thanks
Dave
-
Nov 8th, 2018, 05:15 AM
#2
Re: Date should be between 'MinDate' and 'MaxDate' ?
There is nothing in the code that you have shown that would cause that error message. The error message suggests that you're setting the Value property of a DateTimePicker. The MinDate and MaxDate the error message mentions are also properties of the DateTimePicker.
-
Nov 8th, 2018, 07:58 AM
#3
Thread Starter
Addicted Member
Re: Date should be between 'MinDate' and 'MaxDate' ?
Doh, Doh, Doh!!!! My bad.... I'd some how copied a date picker but named it textbox....! All working as it should now, sorry..
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
|