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;
The name of the layout.
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"; }
InputLanguage Class | InputLanguage Members | System.WinForms Namespace | GetCurrentInputLanguage