This documentation is archived and is not being maintained.

InputLanguage.LayoutName Property

Gets the name of the current keyboard layout as it appears in the regional settings of the operating system on the computer.

[Visual Basic]
Public ReadOnly Property LayoutName As String
[C#]
public string LayoutName {get;}
[C++]
public: __property String* get_LayoutName();
[JScript]
public function get LayoutName() : String;

Property Value

The name of the layout.

Example

[Visual Basic, C#, C++] The following example gets the culture associated with the current input language and displays the culture name.

[Visual Basic, C#, C++] First, CurrentInputLanguage is called to get the current input language. Then, Culture is called to get the culture information for this input language. Finally, EnglishName is retrieved and displayed in a text box.

[Visual Basic] 
Public Sub MyLayoutName()
   ' Gets the current input language.
   Dim myCurrentLanguage As InputLanguage = InputLanguage.CurrentInputLanguage
       
   If Not (myCurrentLanguage Is Nothing) Then
      textBox1.Text = "Layout: " & myCurrentLanguage.LayoutName
   Else
      textBox1.Text = "There is no current language"
   End If
End Sub


[C#] 
public void MyLayoutName() {
   // Gets the current input language.
   InputLanguage myCurrentLanguage = InputLanguage.CurrentInputLanguage;

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


[C++] 
public:
 void MyLayoutName() {
    // Gets the current input language.
    InputLanguage* myCurrentLanguage = InputLanguage::CurrentInputLanguage;
 
    if(myCurrentLanguage != 0) 
       textBox1->Text = String::Format( S"Layout: {0}", myCurrentLanguage->LayoutName );
    else
       textBox1->Text = S"There is no current language";
 }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

InputLanguage Class | InputLanguage Members | System.Windows.Forms Namespace | CurrentInputLanguage

Show: