Click here to Skip to main content
15,888,816 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello!
I use dataTimePicker in my application.

I set CustomFormat MM/dd/yyyy hh:mm:ss

After clicking at DataTimePicker shows only calendar for choose data. But how to make that after clicking hours:minutes - displays chosing form time?
Thank you!
Posted

C#
timePicker = new DateTimePicker();
timePicker.Format = DateTimePickerFormat.Time;
timePicker.ShowUpDown = true;




Source:
http://stackoverflow.com/questions/5593686/c-sharp-make-datetimepicker-work-as-only-timepicker[^]
 
Share this answer
 
Comments
[no name] 18-Apr-13 12:36pm    
No i want make calendar and time at one control DataPicketTime
Pheonyx 18-Apr-13 13:29pm    
I do not believe that is possible, you might want to look at using two controls and combining the result, or even creating your own custom control.
Hi,

Please use the below settings for dateTimePicker :

Format : "Custom"
CustomFormat : "yyyy.MM.dd HH:mm"

This should make the dateTimepicker control eligible to pick both date and time.

Cheers !
 
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