InputLanguageManager.SetInputLanguage(DependencyObject, CultureInfo) Метод

Определение

Задает значение присоединенного свойства InputLanguage для указанного объекта зависимости.Sets the value of the InputLanguage attached property on the specified dependency object.

public:
 static void SetInputLanguage(System::Windows::DependencyObject ^ target, System::Globalization::CultureInfo ^ inputLanguage);
public static void SetInputLanguage (System.Windows.DependencyObject target, System.Globalization.CultureInfo inputLanguage);
static member SetInputLanguage : System.Windows.DependencyObject * System.Globalization.CultureInfo -> unit
Public Shared Sub SetInputLanguage (target As DependencyObject, inputLanguage As CultureInfo)

Параметры

target
DependencyObject

Объект зависимости, для которого требуется задать присоединенное свойство InputLanguage.The dependency object on which to set the InputLanguage attached property.

inputLanguage
CultureInfo

Объект CultureInfo, представляющий новое значение для присоединенного свойства InputLanguage.A CultureInfo object representing the new value for the InputLanguage attached property.

Исключения

Вызывается, если target имеет значение null.Raised when target is null.

Примеры

В следующем примере показано, как использовать InputLanguageManager для задания языка TextBox ввода элемента.The following example demonstrates how to use an InputLanguageManager to set the input language of a TextBox element.

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()

Применяется к

Дополнительно