如何更改DateTimePicker的区域性 [英] How to change culture of DateTimePicker

查看:74
本文介绍了如何更改DateTimePicker的区域性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将显示在DateTimePicker中的日期更改为阿拉伯语,而无需更改Windows的区域设置.
我尝试了以下代码,但没有成功:

I want to change date displayed in DateTimePicker to Arabic without the need to change region settings of Windows.
I tried the following code but it didn''t work:

Thread.CurrentThread.CurrentCulture = New CultureInfo("ar-EG")
Thread.CurrentThread.CurrentUICulture = New CultureInfo("ar-EG")


我还在网上搜索了一个解决方案,发现DateTimePicker使用操作系统的本地区域性设置,并且无法使用代码进行更改.
这是真的?如果没有的话,我该如何改变它的文化?

我正在使用Visual Basic .Net 2010,这是我在这个功能强大且非常有用的网站中遇到的第一个问题.非常感谢您的帮助.


I also searched the web for a solution I found that DateTimePicker uses the local culture settings of the operating system and couldn''t be changed using code.
Is this true? and if not how I could change its culture?

I''m using Visual Basic .Net 2010 and it is my first question in this great and very useful web site. I appreciate any help please.

推荐答案

It is not possible as stated in this KB[^].
KB状态:

之所以会发生此现象,是因为DateTimePicker控件和MonthCalendar控件是Microsoft Windows通用控件.因此,操作系统的用户区域设置确定这些控件的用户界面.

This behavior occurs because the DateTimePicker control and the MonthCalendar control are Microsoft Windows common controls. Therefore, the operating system''s user locale determines the user interface of these controls.


这篇关于如何更改DateTimePicker的区域性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆