private void Form1_Load(System.Object sender, System.EventArgs e) {DateTimePicker1.Format = DateTimePickerFormat.Custom;DateTimePicker1.CustomFormat = "dd/MM/yyyy";DateTimePicker1.ShowUpDown = false; }
private void Form1_Load(object sender, EventArgs e){// Set format to custom date and timedateTimePicker1.Format = DateTimePickerFormat.Custom;dateTimePicker1.CustomFormat = "dd-MM-yyyy hh:mm tt";}
put this code inside InitializeComponent()dateTimePicker1.Format = DateTimePickerFormat.Custom;dateTimePicker1.CustomFormat = “dd/MM/yyyy”;
tfyuj
set the datepicker control format property set to use a custom format: DateTimePicker1.Format = DateTimePickerFormat.Custom after this by using Customformat you can set your own format. like below DateTimePicker1.CustomFormat = "dd-MM-yyyy"
public void SetMyCustomFormat() {// Set the Format type and the CustomFormat string.dateTimePicker1.Format = DateTimePickerFormat.Custom;dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd"; }