开发者

set System.Threading.Thread.CurrentThread.CurrentCulture on .net compact framework

开发者 https://www.devze.com 2022-12-14 10:25 出处:网络
I need to show a Hijri Date time picker in windows mobile..netcf 2.0 System.Threading.Thread.CurrentThread.CurrentCulture is not defined in .net cf 2.0

I need to show a Hijri Date time picker in windows mobile. .netcf 2.0

System.Threading.Thread.CurrentThread.CurrentCulture is not defined in .net cf 2.0

I have set the controla panel regional settings correctly but the date time picker still shows gregorian dates.

How can I get a Hijri date time picker in windowxs mobile.

T开发者_Python百科hanks.


the best and easy example that I found: Windows Mobile Globalization in Visual Studio except in ReloadForm method, no need to remove and to dispose the controls, just the translation and location should be changed. actually this sample is great not only for translationn but also for resolution-aware handling because it has both translation and position changing if you have added into your resx file.

    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);
    }

I am customising that for my project, let me know if you have any question or better solution, thanks.


System.Globalization.CultureInfo.CurrentCulture and System.Globalization.CultureInfo.CurrentUICulture cannot be set programmatically as only manufacturers can do that. You will need to change the Regional Settings and reset the device.


System.Globalization.CultureInfo.CurrentCulture.* should help...

0

精彩评论

暂无评论...
验证码 换一张
取 消