InputLanguageManager.SetInputLanguage(DependencyObject, CultureInfo) Método

Definición

Establece el valor de la propiedad adjunta InputLanguage en el objeto de dependencia especificado.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)

Parámetros

target
DependencyObject

Objeto de dependencia en el que se establecerá la propiedad adjunta InputLanguage.The dependency object on which to set the InputLanguage attached property.

inputLanguage
CultureInfo

Objeto CultureInfo que representa el nuevo valor para la propiedad adjunta InputLanguage.A CultureInfo object representing the new value for the InputLanguage attached property.

Excepciones

Se genera cuando target es null.Raised when target is null.

Ejemplos

En el ejemplo siguiente se muestra cómo utilizar InputLanguageManager para establecer el idioma de entrada de un TextBox elemento.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()

Se aplica a

Consulte también