Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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), im 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..
C#
CultureInfo TypeOfLanguage = CultureInfo.CreateSpecificCulture("en-US");
System.Threading.Thread.CurrentThread.CurrentCulture = TypeOfLanguage;
InputLanguage l = InputLanguage.FromCulture(TypeOfLanguage);
InputLanguage.CurrentInputLanguage = l;
Posted
Updated 14-Jan-14 9:44am
v2
Comments
Ali Agha 14-Jan-14 15:11pm    
Thanks for reply. The code you referred to is used to change the input language e.g. English (US), i have already done it. but i need to change individual layouts of keyboard within the English (US) language, i hope i explained right !

1 solution

MSDN Sample - Change Keyboard Layout in C#[^]

I know its similar to what you posted, but I have a feeling that your issue is in obtaining the correct input language. See the linked example for something that works and see where the difference is in your code.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 14-Jan-14 19:39pm    
Sure, a 5. However, I would not recommend anyone to change input language in an application, excluding some esoteric cases (such as the application designed to create and test input methods or keyboard layouts).
—SA
Ali Agha 15-Jan-14 1:12am    
Actually i have a project on making multi-lingual typing tutor allowing users to also choose their keyboard layout to type.. that's why i was asking.
U have any solutions?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900