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
2009-06-01 00:33:22
Execellent! Thanks Michael
rmdussa
2009-06-01 00:44:24