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