JOHNSON ANTONY

JOHNSON ANTONY

  • NA
  • 3
  • 1.2k

Multi Lingual C# application - Issue on getting Chinese Lang

Jan 23 2015 10:24 PM

Hi

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

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
Thanks

Johnson




Answers (2)