InputMethod.SetInputScope(DependencyObject, InputScope) Metoda

Definicja

Ustawia wartość dołączonej InputScope właściwości dla określonego obiektu zależności.

public:
 static void SetInputScope(System::Windows::DependencyObject ^ target, System::Windows::Input::InputScope ^ value);
public static void SetInputScope (System.Windows.DependencyObject target, System.Windows.Input.InputScope value);
static member SetInputScope : System.Windows.DependencyObject * System.Windows.Input.InputScope -> unit
Public Shared Sub SetInputScope (target As DependencyObject, value As InputScope)

Parametry

target
DependencyObject

Obiekt zależności, na którym ma być ustawiona InputScope dołączona właściwość.

value
InputScope

Obiekt InputScope reprezentujący nową wartość dołączonej InputScope właściwości.

Wyjątki

Podniesione, gdy target ma wartość null.

Przykłady

W poniższym przykładzie pokazano, jak użyć SetInputScope metody w celu określenia InputScope obiektu skojarzonego z obiektem TextBox .

InputMethod.SetPreferredImeState(myTextBox, InputMethodState.On);
InputMethod.Current.ImeSentenceMode = ImeSentenceModeValues.Automatic;
InputMethod.Current.HandwritingState = InputMethodState.On;
InputMethod.Current.SpeechMode = SpeechMode.Dictation;
InputScope myInputScope = new InputScope();
myInputScope.RegularExpression = "W|P|F";
InputMethod.SetInputScope(myTextBox, myInputScope);
tb6.Text = "Configuration UI Available?: " + InputMethod.Current.CanShowConfigurationUI.ToString();
InputMethod.SetPreferredImeState(myTextBox, InputMethodState.On)
InputMethod.Current.ImeSentenceMode = ImeSentenceModeValues.Automatic
InputMethod.Current.HandwritingState = InputMethodState.On
InputMethod.Current.SpeechMode = SpeechMode.Dictation
Dim myInputScope As New InputScope()
myInputScope.RegularExpression = "W|P|F"
InputMethod.SetInputScope(myTextBox, myInputScope)
tb6.Text = "Configuration UI Available?: " & InputMethod.Current.CanShowConfigurationUI.ToString()

Dotyczy

Zobacz też