InputLanguageManager.AvailableInputLanguages 属性

定义

获取当前可用输入语言的枚举数。

public:
 property System::Collections::IEnumerable ^ AvailableInputLanguages { System::Collections::IEnumerable ^ get(); };
public System.Collections.IEnumerable AvailableInputLanguages { get; }
member this.AvailableInputLanguages : System.Collections.IEnumerable
Public ReadOnly Property AvailableInputLanguages As IEnumerable

属性值

当前可用输入语言的枚举器;如果没有可用的输入语言, null 则为 。 此属性没有默认值。

示例

以下示例演示如何使用 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()

适用于