I am developing a c# Winforms application using VS 2008 and DevExpress.

In one form, I need the some data to be added both in English and Chinese Language. So I placed separate textboxes for both Chinese and English and two buttons on form. one Button click shows Chinese language section and changes Inputlanguage . Second button hides Chinese language section, Changes InputLanguage .

When I run the application, First time when I change to Chinese Language, I am getting Chinese language selection option on typing English letter combination. But after returning to English, if I again go to Chinese data entry, I am not getting Chinese Language support on typing English.

But I am seeing the Language change on Taskbar.

Language Change Code
1st method

 foreach (InputLanguage lang in InputLanguage.InstalledInputLanguages) 
 CName = lang.Culture.EnglishName.ToString(); 
 if (CName.StartsWith("Chinese")) //"English" 
      InputLanguage.CurrentInputLanguage = lang; 

2nd Method

Thread.CurrentThread.CurrentCulture = new CultureInfo("zh-CN"); 
Thread.CurrentThread.CurrentUICulture = new CultureInfo("zh-CN");

I tried this with normal windows forms project and controls( Not Devexpress form) still the issue not solved.

If we change input language manually at Taskbar, I am getting Language selection option. The Issue is only
with language change from code.

Please give me a immediate advice


My advice to you is to:
1. Read the standard documentation, which clearly states that ...CurrentCulture = new CultureInfo(...) "is a per-thread setting that determines the default formats for dates, times, currency, and numbers, the sorting order of text, string comparisons, and casing. The CurrentCulture property is not a language setting." (https://technet.microsoft.com/en-us/subscriptions/se513yha%28VS.71%29.aspx)
2. Find as much documentation as you can and try the examples they provide before posting half-baked code and asking for immediate advice.
3. Read this article, because it provides the information you seek: "How to Localize Windows Forms and Change the Language at Runtime" http://www.dotnetcurry.com/showarticle.aspx?ID=174

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.