InputLanguage.CurrentInputLanguage 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定目前執行緒的輸入語言。
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,表示目前執行緒的輸入語言。
例外狀況
系統無法識別輸入語言。
範例
下列程式碼範例會取得並顯示目前輸入語言的名稱。 此程式碼假設 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