Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You must detect Windows OS input language changes and change it to your desired language for your application when it has focus. So read following articles for detecting Windows OS input language changes: 1. <a href="http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms644990(VS.85).aspx</a> 2. <a href="http://www.codeproject.com/KB/system/TrayMe.aspx" rel="nofollow">http://www.codeproject.com/KB/system/TrayMe.aspx</a> And then use from following codes to achieve to your goal:</p> <pre><code>/// &lt;summary&gt; /// Changing Current Input Language to a next installed language /// &lt;/summary&gt; public void ChangeInputLanguage() { // Nothing to do if there is only one Input Language supported: if (InputLanguage.InstalledInputLanguages.Count == 1) return; // Get index of current Input Language int currentLang = InputLanguage.InstalledInputLanguages.IndexOf(InputLanguage.CurrentInputLanguage); // Calculate next Input Language InputLanguage nextLang = ++currentLang == InputLanguage.InstalledInputLanguages.Count ? InputLanguage.InstalledInputLanguages[0] : InputLanguage.InstalledInputLanguages[currentLang]; // Change current Language to the calculated: ChangeInputLanguage(nextLang); } /// &lt;summary&gt; /// Changing current Input Language to a new one passed in the param /// &lt;/summary&gt; /// &lt;param name="ISOLang"&gt;ISO Culture name string code e.g. "en" for English&lt;/param&gt; public void ChangeInputLanguage(string ISOLang) { // Convert ISO Culture name to InputLanguage object. Be aware: if ISO is not supported // ArgumentException will be invoked here InputLanguage nextLang = InputLanguage.FromCulture(new System.Globalization.CultureInfo(ISOLang)); ChangeInputLanguage(nextLang); } /// &lt;summary&gt; /// Changing current Input Language to a new one passed in the param /// &lt;/summary&gt; /// &lt;param name="LangID"&gt;Integer Culture code e.g. 1033 for English&lt;/param&gt; public void ChangeInputLanguage(int LangID) { // Convert Integer Culture code to InputLanguage object. Be aware: if Culture code is not supported // ArgumentException will be invoked here InputLanguage nextLang = InputLanguage.FromCulture(new System.Globalization.CultureInfo(LangID)); ChangeInputLanguage(nextLang); } /// &lt;summary&gt; /// Changing current Input Language to a new one passed in the param /// &lt;/summary&gt; /// &lt;param name="InputLang"&gt;New Input Language as InputLanguage object&lt;/param&gt; public void ChangeInputLanguage(InputLanguage InputLang) { // Check is this Language really installed. Raise exception to warn if it is not: if (InputLanguage.InstalledInputLanguages.IndexOf(InputLang) == -1) throw new ArgumentOutOfRangeException(); // InputLAnguage changes here: InputLanguage.CurrentInputLanguage = InputLang; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload