Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / April 2005

Tip: Looking for answers? Try searching our database.

Customized DateTimePicker

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lynn - 25 Apr 2005 16:55 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.