简体   繁体   中英

How to change individual keyboard layouts using C#

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 eg 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 (eg 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;

This Worked For me

System.Globalization.CultureInfo TypeOfLanguage = new 
System.Globalization.CultureInfo("en-US");
InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(TypeOfLanguage);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM