tags:

views:

440

answers:

1

I am developing C# application and would like to allow user to enter the time as well as date in datetimepicker.Please let me know how to acheive this

+5  A: 

You need to instruct the DateTimePicker control to use a custom format, and provide a format that includes time elements:

this.dateTimePicker1.CustomFormat = "MMMM dd, yyyy hh:mm";
this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;

You can do this in the designer as well.

Michael Petrotta
Execellent! Thanks Michael
rmdussa