Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C#3.0 .NET3.5
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 10-May-11 23:42pm
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 at 11-May-11 13:25pm
Correct, my 5. Could be DateTime.Now. It depends of semantic -- there is not universal "reset".
CS2011 at 11-May-11 22:54pm
Have you tried ResetText() of date time if yes can you explain what it does.
SAKryukov at 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 at 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 at 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 at 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
0 OriginalGriff 500
1 Prakriti Goyal 292
2 Yogesh Kumar Tyagi 224
3 Maciej Los 195
4 CPallini 170
0 OriginalGriff 6,652
1 Sergey Alexandrovich Kryukov 5,449
2 Maciej Los 3,474
3 Peter Leow 3,303
4 DamithSL 2,505

Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 11 May 2011
Copyright © CodeProject, 1999-2014
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