InputLanguage.CurrentInputLanguage Property

 

Gets or sets the input language for the current thread.

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

public static InputLanguage CurrentInputLanguage { get; set; }

Property Value

Type: System.Windows.Forms.InputLanguage

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

Exception Condition
ArgumentException

The input language is not recognized by the system.

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

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;
}

SecurityPermission

for access to unmanaged code. Associated enumeration: UnmanagedCode

.NET Framework
Available since 1.1
Return to top
Show: