TextCompositionManager.AddPreviewTextInputHandler(DependencyObject, TextCompositionEventHandler) 方法

定義

加入 PreviewTextInput 附加事件的處理常式。Adds a handler for the PreviewTextInput attached event.

public:
 static void AddPreviewTextInputHandler(System::Windows::DependencyObject ^ element, System::Windows::Input::TextCompositionEventHandler ^ handler);
public static void AddPreviewTextInputHandler (System.Windows.DependencyObject element, System.Windows.Input.TextCompositionEventHandler handler);
static member AddPreviewTextInputHandler : System.Windows.DependencyObject * System.Windows.Input.TextCompositionEventHandler -> unit
Public Shared Sub AddPreviewTextInputHandler (element As DependencyObject, handler As TextCompositionEventHandler)

參數

element
DependencyObject

要在其中加入事件處理常式的相依性物件。A dependency object to add the event handler to. 相依性物件必須是 UIElementContentElementThe dependency object must be a UIElement or a ContentElement.

handler
TextCompositionEventHandler

可指定要加入之處理常式的委派。A delegate that designates the handler to add.

備註

這個方法會為此事件的通道版本新增處理常式。This method adds a handler for the tunneling version of this event. 如需此事件之反升版本的詳細資訊,請參閱 TextInputFor information about the bubbling version of this event, see TextInput.

適用於

另請參閱