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.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
property String^ LayoutName {
	String^ get();
}

Property Value

Type: System::String^

The name of the layout.

The following code example gets the culture associated with the current input language and displays the culture name.

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.

public:
   void MyLayoutName()
   {
      // Gets the current input language.
      InputLanguage^ myCurrentLanguage = InputLanguage::CurrentInputLanguage;

      if ( myCurrentLanguage != nullptr )
      {
         textBox1->Text = String::Format( "Layout: {0}", myCurrentLanguage->LayoutName );
      }
      else
      {
         textBox1->Text = "There is no current language";
      }
   }

.NET Framework
Available since 1.1
Return to top
Show: