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.GetLayoutName

Returns the name of the current keyboard layout as it appears in the Windows Regional Settings on the computer.

[Visual Basic]
Overridable Public Function GetLayoutName() As String
[C#]
public virtual string GetLayoutName();
[C++]
public: virtual String* GetLayoutName();
[JScript]
public function GetLayoutName() : String;

Return Value

The name of the layout.

Example [C#]

The following example gets and displays the name of the current keyboard layout. First, GetCurrentInputLanguage is called to get the current input language of this thread. Then GetLayoutName is called to get the name of the current keyboard layout. The keyboard layout name is displayed in a text box. This code assumes Button1 and TextBox1 have been instantiated.

[C#]

public void MyLayoutName() {
   //Get the current input language.
   InputLanguage myCurrentLanguage = InputLanguage.GetCurrentInputLanguage();

   if(myCurrentLanguage != null) 
      textBox1.Text = "Layout: " + myCurrentLanguage.GetLayoutName();
   else
      textBox1.Text = "There is no current language";
}

See Also

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