在.net精简框架中设置System.Threading.Thread.CurrentThread.CurrentCulture
问题描述:
我需要在Windows Mobile中显示Hijri Date时间选择器。 .netcf 2.0在.net精简框架中设置System.Threading.Thread.CurrentThread.CurrentCulture
System.Threading.Thread.CurrentThread.CurrentCulture没有在.NET CF 2.0
我有区域设置是否正确的controla面板定义,但日期时间选择器仍显示公历日期。
如何在windowxs mobile中获得Hijri日期时间选择器。
谢谢。
答
我发现的最简单的例子: Windows Mobile Globalization in Visual Studio 除了在ReloadForm方法中,不需要移除和处理控件,只需要改变翻译和位置即可。实际上,这个示例不仅适用于translaten,而且适用于解决方案感知处理,因为如果您已添加到resx文件中,它将翻译和位置更改。
private void SetCaptions()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.SuspendLayout();
for (int i = 0; i != Controls.Count; i++)
{
//controls[i].Dispose();
resources.ApplyResources(Controls[i], Controls[i].Name, Program.Culture);
}
resources.ApplyResources(this, "$this", Program.Culture);
this.ResumeLayout(false);
}
我定制,对于我的项目,让我知道如果您有任何问题或更好的解决方案,谢谢。
答
System.Globalization.CultureInfo.CurrentCulture。*应该帮助...
答
System.Globalization.CultureInfo.CurrentCulture
和System.Globalization.CultureInfo.CurrentUICulture
不能以编程方式设置为唯一厂家能做到这一点。您需要更改区域设置并重置设备。