Click here to Skip to main content
15,867,973 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
regards
Posted

Why can't you just use

C#
DateTimePicker1.Value = New DateTime("your date here");
?
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-May-11 13:25pm    
Correct, my 5. Could be DateTime.Now. It depends of semantic -- there is not universal "reset".
--SA
CS2011 11-May-11 22:54pm    
Have you tried ResetText() of date time if yes can you explain what it does.
Sergey Alexandrovich Kryukov 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?
--SA
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.

http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.aspx
Sergey Alexandrovich Kryukov 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?
--SA
if you want to reset datetimepicker control try this
dateTimePicker1.ResetText() 
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900