I am trying to build a customized DateTimePicker control to handle null
values. One restriction I have to place on the control is to set the MaxDate
to the current sytem date and time. However when I use my customized date
control, the MaxDate value doesn't refresh to the current time when I am
ready to save the value to the database. It holds the initial system
date/time assigned when the control loads. This is not the case when I use
the original DateTimePicker. I test this out by returning the
DateTimePicker.Value.ToString in the original control and in my customized
control. The time in the original control gets refreshed and matches the
current time, however on the customized control, the time doesn't reflect the
most current time.
In handling the null value situation, I am overriding the following methods:
OnKeyDown, OnCloseUp, and overriding the Value property.
Thanks,
Lynn
Claudio Grazioli - 25 Apr 2005 17:50 GMT
Lynn,
> I am trying to build a customized DateTimePicker control to handle null
> values. One restriction I have to place on the control is to set the MaxDate
[quoted text clipped - 10 lines]
> In handling the null value situation, I am overriding the following methods:
> OnKeyDown, OnCloseUp, and overriding the Value property.
I do not understand your problem to the last detail, maybe some code would
be helpful.
But anyway, have a look at this nullable DateTimePicker control:
http://www.codeproject.com/cs/miscctrl/NullableDateTimePicker.asp
Maybe it solves your problem.

Signature
Claudio Grazioli
http://www.grazioli.ch
http://www.grazioli.ch/HommingbergerGepardenforelle/
Lynn - 26 Apr 2005 22:01 GMT
I figured out how to solve my problem. Thanks for the code samples.
> Lynn,
>
[quoted text clipped - 20 lines]
>
> Maybe it solves your problem.
"Jeffrey Tan[MSFT]" - 27 Apr 2005 03:13 GMT
Hi Lynn,
Cool! I am glad your problem is resolved. If you need further help, please
feel free to post. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
"Jeffrey Tan[MSFT]" - 26 Apr 2005 03:58 GMT
Hi Lynn,
Thanks for your post!!
Can you provide some sample code snippet or a reproduce sample project to
help us understand the details of your problem? Currently, I thinkyour
implementation details is still not very clear to us. Once you can help us
reproduce out your problem, we can help you track out the cause. Thanks
Also, Claudio Grazioli has provide you a sample article of implementing
Nullable DateTimePicker, you may get some hint from this article. If you
need further help, please feel free to feedback. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.