How to change culture to a DateTimepicker or calendar control in .Net

后端 未结 6 654
悲&欢浪女
悲&欢浪女 2020-12-05 14:59

How to set internationalization to a DateTimepicker or Calendar WinForm control in .Net when the desire culture is different to the one installed i

6条回答
  •  失恋的感觉
    2020-12-05 16:01

    I think there is detour.

    1. set event handler "ValueChanged"
    2. code

      dateTimePicker.Format = DateTimePickerFormat.Custom;
      string[] formats = dateTimePicker.Value.GetDateTimeFormats(Application.CurrentCulture);
      dateTimePicker.CustomFormat = formats[0];
      

提交回复
热议问题