InputLanguageManager.Current 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取与当前上下文关联的输入语言管理器。
public:
static property System::Windows::Input::InputLanguageManager ^ Current { System::Windows::Input::InputLanguageManager ^ get(); };
public static System.Windows.Input.InputLanguageManager Current { get; }
static member Current : System.Windows.Input.InputLanguageManager
Public Shared ReadOnly Property Current As InputLanguageManager
属性值
一个与当前上下文关联的 InputLanguageManager 对象。
此属性没有默认值。
示例
以下示例演示如何使用 InputLanguageManager 访问与当前上下文关联的语言管理器。
this.Dispatcher.Thread.CurrentCulture.Name.ToString();
InputLanguageManager.SetInputLanguage(myTextBox, CultureInfo.CreateSpecificCulture("fr"));
tb2.Text = "Available Input Languages:";
lb1.ItemsSource = InputLanguageManager.Current.AvailableInputLanguages;
tb3.Text = "Input Language of myTextBox is " + InputLanguageManager.GetInputLanguage(myTextBox).ToString();
tb4.Text = "CurrentCulture is Set to " + this.Dispatcher.Thread.CurrentCulture.Name.ToString();
Me.Dispatcher.Thread.CurrentCulture.Name.ToString()
InputLanguageManager.SetInputLanguage(myTextBox, CultureInfo.CreateSpecificCulture("fr"))
tb2.Text = "Available Input Languages:"
lb1.ItemsSource = InputLanguageManager.Current.AvailableInputLanguages
tb3.Text = "Input Language of myTextBox is " & InputLanguageManager.GetInputLanguage(myTextBox).ToString()
tb4.Text = "CurrentCulture is Set to " & Me.Dispatcher.Thread.CurrentCulture.Name.ToString()