共用方式為


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

適用於

另請參閱