Sunday, December 9, 2012

DatePicker Control - CustomFormat

If you want to apply a custom format to the datepicker control in Windows Forms, an important thing to do is to set its Format property to "Custom"
e.g. If you want to set the DatePickers custom date format to "mm/dd/yyyy" you need to write following in the designer's code-

this.DatePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Custom;
this.DatePicker1.CustomFormat = "MM/dd/yyyy";

 

No comments:

Post a Comment