Condividi tramite


InputLanguageManager.SetInputLanguage(DependencyObject, CultureInfo) Metodo

Definizione

Imposta il valore della proprietà associata InputLanguage per l'oggetto dipendenza specificato.

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)

Parametri

target
DependencyObject

Oggetto dipendenza per cui impostare la proprietà associata InputLanguage.

inputLanguage
CultureInfo

Oggetto CultureInfo che rappresenta il nuovo valore per la proprietà associata InputLanguage.

Eccezioni

Generato quando target è null.

Esempio

Nell'esempio seguente viene illustrato come usare un InputLanguageManager oggetto per impostare il linguaggio di input di un TextBox elemento.

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

Si applica a

Vedi anche