2010-06-30 158 views
4

是否有任何属性来设置datetimepicker的语言?如何设置datetimepicker的语言?

当显示日历,那就是 - 如果我想显示在西班牙的工作日,例如...

+0

貌似的DateTimePicker总是会使用OS文化,而不是你的应用程序之一。请参阅https://support.microsoft.com/en-us/help/889834/the-datetimepicker-and-monthcalendar-control-do-not-reflect-the-curren – user276648 2017-10-05 09:41:57

回答

0

你不能改变的文化,它包含除其他事项外平日的名字,上像DateTimePicker这样的单个控件,但在线程级别。

+0

好的 - 谢谢!然后我知道这是不可能的datetimepicker本身:-) – 2010-06-30 11:03:00

+2

我刚刚检查;更改文化将使用新文化的日期格式,但至少在Win7上,弹出窗口仍然使用OS用户文化的字符串。 – OregonGhost 2010-07-01 13:05:24

+1

@OregonGhost看起来像DateTimePicker将始终使用OS文化,而不是您的应用程序。请参阅https://support.microsoft.com/en-us/help/889834/the-datetimepicker-and-monthcalendar-control-do-not-reflect-the-curren – user276648 2017-10-05 09:42:15

2

你可以改变文化为主题:

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

良好的信息!我可能不会这样做,虽然... – 2010-06-30 11:03:31

+4

我已经尝试过,但它仍然使用操作系统的平日和月份名称... – colmde 2015-08-05 13:20:58

+1

@colmde看起来像DateTimePicker将始终使用OS文化,而不是您的应用程序之一。请参阅https://support.microsoft.com/zh-CN/help/889834/the-datetimepicker-and-monthcalendar-control-do-not-reflect-the-curren – user276648 2017-10-05 09:42:28