4
Reply

How do I set Custom Date Format in DateTimePicker (WinForms)

SaiRoja

SaiRoja

10y
12.7k
0
Reply

    private void Form1_Load(System.Object sender, System.EventArgs e) {DateTimePicker1.Format = DateTimePickerFormat.Custom;DateTimePicker1.CustomFormat = "dd/MM/yyyy";DateTimePicker1.ShowUpDown = false; }

    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"; }