Click here to Skip to main content
15,896,912 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

how can I restrict to user to select only a specific time range in "datetimepicker" control windows c#.

Thanks in advance...
Posted
Updated 26-Jul-15 23:56pm
v2

DateTimePicker has properties "MinDate" and "MaxDate".
You should just put them to your time range in designer or by code:

C#
this.dateTimePicker1.MaxDate = new System.DateTime(2015, 7, 27);
 this.dateTimePicker1.MinDate = new System.DateTime(2015, 7, 20);
 
Share this answer
 
You can use the MinDate[^] and MaxDate[^] properties.
 
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