NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

InputLanguage.SelectNext

Sets the next input language in the language list as the current input language.

[Visual Basic]
Public Shared Sub SelectNext( _
   ByVal forward As Boolean, _
   ByVal flags As Integer _
)
[C#]
public static void SelectNext(
   bool forward,
   int flags
);
[C++]
public: static void SelectNext(
   bool forward,
   int flags
);
[JScript]
public static function SelectNext(
   forward : Boolean,
   flags : int
);

Parameters

forward
true to move forward through the language list; otherwise, false.
flags
A set of flags that control the behavior of this method.

Remarks

The following table shows possible values for the flags parameter. The flags can be combined.

Flag Description
SET_FOR_PROCESS Sets the new input language for the process, not just for the current thread.
MOVE_TO_FRONT Moves the new input language to the front of the language list.

You can switch between two different input languages by making successive calls to this method using the MOVE_TO_FRONT flag.

Example [C#]

The following example gets the InputLanguage for the current input language. This is displayed in a text box. Then SelectNext is called to change the current input language for the process to the next language in the language list. The name of the new input language is displayed in a text box.

This code assumes Button1 and TextBox1 have been instantiated.

[C#]

public void SetNextLanguage() {
   //Get the current input language.
   InputLanguage myCurrentLanguage = InputLanguage.GetCurrentInputLanguage();
   textBox1.Text = "Current input language is: " + myCurrentLanguage.GetCulture().EnglishName + '\n';

   InputLanguage.SelectNext(true, InputLanguage.SET_FOR_PROCESS);
   textBox1.Text += "Next input language is: " + myCurrentLanguage.GetCulture().EnglishName;
}

See Also

InputLanguage Class | InputLanguage Members | System.WinForms Namespace | GetCurrentInputLanguage | GetLayoutName