max61
Crypto Attack Strategist
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
200 XP
In this tutorial I will teach you how to disable previous date in the datetimepicker using c#. This simple program will help you for filtering the date displayed in the datetimepicker. It will disable the dates in the calendar beyond the current date. Hope this simple program will help you if you encounter this kind of problem. Let’s begin.
Creating a Program
Step 1
Open Microsoft Visual Studio 2015 and create a new windows form application.
Step 2
Do the form just like shown below.
Step 3
Double click the “Disable” button and add the following code to disable the previous date when the button is clicked.
Step 4
Double click the “Enable” button and add the following code to enable the previous date when the button is clicked.
Output
Creating a Program
Step 1
Open Microsoft Visual Studio 2015 and create a new windows form application.

Step 2
Do the form just like shown below.

Step 3
Double click the “Disable” button and add the following code to disable the previous date when the button is clicked.
- dateTimePicker1.
MinDate
=
DateTime.
Now
;
Step 4
Double click the “Enable” button and add the following code to enable the previous date when the button is clicked.
- dateTimePicker1.
MinDate
=
DateTime.
Parse
(
"01/01/1753"
)
;
Output
