DateTimePicker reset min max Date

Hello EE,

in my code, i change the MinDAte and maxDate of the datetimepicker...
but i would like to be able to put it back on "Default values" also.

I know i could type like  .mindate = '1800-01-01' or something like that but is there an event or method i can call that it refreshes the control to default values like if I had just create it?

A kind of:  dtpPicker.Refresh()  dtpPicket.ResetValues   you know
LVL 1
PhilippeRenaudAsked:
Who is Participating?
 
ExpertHelp79Commented:
to refresh

dateTimePicker1.Value = System.DateTime.Now;


===========================================================

picker.Value = picker.Value.Date;
EDIT: To specify a particular time, you'd use something like:
TimeSpan time = new TimeSpan(3, 30, 0); // 3 hours and 30 minutespicker.Value = picker.Value.Date + time;

==================================================================
'Created a global string variable with initial value
     Dim gstrStartDate As String = "20/01/1988"    '(Australian Date Format)

Private Sub btnReset_Click
'Set Start Date to 20/01/1988
        gstrStartDate = "20/01/1988"
        dtpStartDate.Value = Convert.ToDateTime(gstrStartDate)
End Sub

Moderation note: https://stackoverflow.com/questions/1282366/how-to-reset-the-time-of-datetimepicker-in-c-sharp/1282471#1282471
0
 
PhilippeRenaudAuthor Commented:
thks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.