Disable dates before the current day in DateTimePicker?

6

Is it possible in DateTimePicker , disable the days before the current day?

    
asked by anonymous 07.08.2015 / 18:58

1 answer

5

You can do this by adding the dates you want in MinDate " and MaxDate ", obviously the minimum can be the shortest valid date and the maximum the day before yesterday. Something like this:

this.dateTimePicker1.MaxDate = DateTime.Today.AddDays(-1);
this.dateTimePicker1.MinDate = DateTimePicker.MinimumDateTime;

The question has changed midway but the answer remains the same, as the control changes but the MinDate " and MaxDate are identical.

    
07.08.2015 / 19:07