InputLanguage.CurrentInputLanguage 属性

定义

获取或设置当前线程的输入语言。

public:
 static property System::Windows::Forms::InputLanguage ^ CurrentInputLanguage { System::Windows::Forms::InputLanguage ^ get(); void set(System::Windows::Forms::InputLanguage ^ value); };
public static System.Windows.Forms.InputLanguage CurrentInputLanguage { get; set; }
member this.CurrentInputLanguage : System.Windows.Forms.InputLanguage with get, set
Public Shared Property CurrentInputLanguage As InputLanguage

属性值

InputLanguage

InputLanguage,表示当前线程的输入语言。

例外

系统未识别输入语言。

示例

下面的代码示例获取并显示当前输入语言的名称。 此代码假定 textBox1 已实例化。

public:
   void MyCurrentInputLanguage()
   {
      // Gets the current input language  and prints it in a text box.
      InputLanguage^ myCurrentLanguage = InputLanguage::CurrentInputLanguage;
      textBox1->Text = String::Format( "Current input language is: {0}",
         myCurrentLanguage->Culture->EnglishName );
   }
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;
}
Public Sub MyCurrentInputLanguage()
   ' Gets the current input language  and prints it in a text box.
   Dim myCurrentLanguage As InputLanguage = InputLanguage.CurrentInputLanguage
   textBox1.Text = "Current input language is: " & _
       myCurrentLanguage.Culture.EnglishName
End Sub

适用于

另请参阅