InputLanguage.CurrentInputLanguage Property

Definition

Gets or sets the input language for the current thread.

C#
public static System.Windows.Forms.InputLanguage CurrentInputLanguage { get; set; }

Property Value

An InputLanguage that represents the input language for the current thread.

Exceptions

The input language is not recognized by the system.

Examples

The following code example gets and displays the name of the current input language. This code assumes that textBox1 has been instantiated.

C#
public void MyCurrentInputLanguage() {
   // Gets the current input language  and prints it in a text box.
   InputLanguage myCurrentLanguage = InputLanguage.CurrentInputLanguage;
   textBox1.Text = "Current input language is: " +
       myCurrentLanguage.Culture.EnglishName;
}

Applies to

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, 10

See also