InputLanguageManager.SetInputLanguage(DependencyObject, CultureInfo) メソッド

定義

指定した依存関係オブジェクトの InputLanguage 添付プロパティの値を設定します。

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 添付プロパティを設定する依存関係オブジェクト。

inputLanguage
CultureInfo

InputLanguage 添付プロパティの新しい値を表す CultureInfo オブジェクト。

例外

targetnull の場合に発生します。

次の例では、 を InputLanguageManager 使用して要素の入力言語を設定する方法を TextBox 示します。

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

適用対象

こちらもご覧ください