Set default format of datetimepicker as dd-MM-yyyy

后端 未结 5 1610
情歌与酒
情歌与酒 2021-02-02 08:14

I have a datetimepicker which on loading of windows form shows me format in \'MM-dd-yyyy\',

as follows:

\"en

5条回答
  •  醉酒成梦
    2021-02-02 08:25

    Ensure that control Format property is properly set to use a custom format:

    DateTimePicker1.Format = DateTimePickerFormat.Custom
    

    Then this is how you can set your desired format:

    DateTimePicker1.CustomFormat = "dd-MM-yyyy"
    

提交回复
热议问题