InputLanguage.LayoutName Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the name of the current keyboard layout as it appears in the regional settings of the operating system on the computer.
public:
property System::String ^ LayoutName { System::String ^ get(); };
public string LayoutName { get; }
member this.LayoutName : string
Public ReadOnly Property LayoutName As 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";
}
}
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";
}
Public Sub MyLayoutName()
' Gets the current input language.
Dim myCurrentLanguage As InputLanguage = InputLanguage.CurrentInputLanguage
If (myCurrentLanguage IsNot Nothing) Then
textBox1.Text = "Layout: " & myCurrentLanguage.LayoutName
Else
textBox1.Text = "There is no current language"
End If
End Sub
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: