本文介绍了如何通过c#代码更改键盘布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发一种多语言应用程序,允许用户更改语言和键盘布局(通过组合框)。我能够成功地改变应用程序的文化,但我无法更改单个键盘布局,例如对于英语(美国),我无法将布局从QWERTY(默认)改为Dvorak - 左手等.Plz帮我解决了这个问题。非常感谢这里的代码(例如英语),已经添加了导入等。
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..
CultureInfo TypeOfLanguage = CultureInfo.CreateSpecificCulture("en-US");
System.Threading.Thread.CurrentThread.CurrentCulture = TypeOfLanguage;
InputLanguage l = InputLanguage.FromCulture(TypeOfLanguage);
InputLanguage.CurrentInputLanguage = l;
推荐答案
这篇关于如何通过c#代码更改键盘布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!