Click here to Skip to main content
12,818,489 members (34,995 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#3.0 .NET3.5 C# .NET
I am making desktop application using C#.NET and SQL SERVER
i have made RESET button on form for resetting values inthe textbox as blank
i have taken datetimepicker control with respective textbox .how can i reset its value.
thanx in advance
Posted 11-May-11 0:42am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Why can't you just use

DateTimePicker1.Value = New DateTime("your date here");
SAKryukov 11-May-11 13:25pm
Correct, my 5. Could be DateTime.Now. It depends of semantic -- there is not universal "reset".
CS2011 11-May-11 22:54pm
Have you tried ResetText() of date time if yes can you explain what it does.
SAKryukov 11-May-11 23:15pm
No, as this is inherited method, so documentation does not tell it, and I did not try. Can you explain it, please?
CS2011 11-May-11 23:26pm
Yes it is inherited from Control and it resets the Text property to its default value. and it's in the documentation.Check it out.
SAKryukov 12-May-11 0:49am
Thank you, when I said "documentation does not tell it", I meant exactly this page. It does not tell. Franky, don't want to try it; I did not provide the answer to this question. Do you know what's the value after reset?
CS2011 12-May-11 1:02am
Do you know what's the value after reset?
Yes. Value get reset to default value too.Try and find out. Not a big deal dude.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

if you want to reset datetimepicker control try this

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 11 May 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100