-1

I am developing a multi-lingual application allowing users to change language as well as keyboard layouts (through combobox). I am able to change the culture of application successfully but I'm unable to change the individual keyboard layouts e.g. for English (United States), I'm unable to change layouts from QWERTY (default) to Dvorak - Left hand etc.. Plz help me in this matter. Thanks alot. Here's the code (e.g. for English language), the imports etc. are added already.

CultureInfo TypeOfLanguage = CultureInfo.CreateSpecificCulture("en-US");
System.Threading.Thread.CurrentThread.CurrentCulture = TypeOfLanguage;
InputLanguage l = InputLanguage.FromCulture(TypeOfLanguage);
InputLanguage.CurrentInputLanguage = l;
dosnetCore
  • 55
  • 9
Solat Ali
  • 39
  • 1
  • 6
  • 1
    There isn't anybody that speaks a language named "Dvorak". InputLanguage cannot handle multiple layouts for a culture, you need pinvoke. Changing the layout to Dvorak for only one process never makes much sense, use the language bar instead. – Hans Passant Jan 14 '14 at 18:47
  • I know it isn't necessary but it's part of the project have to do.. If i had to use "pinvoke", can you plz explain it ?? i also read something about user32.dll, any thoughs ? – Solat Ali Jan 14 '14 at 19:03

1 Answers1

0

This Worked For me

System.Globalization.CultureInfo TypeOfLanguage = new 
System.Globalization.CultureInfo("en-US");
InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(TypeOfLanguage);
Ar Win
  • 106
  • 7