How do I set the language for datetimepicker?

梦想与她 提交于 2019-12-04 03:39:48

问题


Is there any property to set the language for datetimepicker?

When displaying the calendar, that is - if I want the week days to be displayed in Spanish, for example...


回答1:


You can't change the culture, which contains weekdays names among other things, on a single control like the DateTimePicker, but at thread level.




回答2:


You can change culture for thread:

 System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo("es-ES");
 System.Threading.Thread.CurrentThread.CurrentCulture = culture;
 System.Threading.Thread.CurrentThread.CurrentUICulture = culture;


来源:https://stackoverflow.com/questions/3148234/how-do-i-set-the-language-for-datetimepicker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!