ContentElement.TextInput ContentElement.TextInput ContentElement.TextInput ContentElement.TextInput Event


此元素以一種與裝置無關的方式取得文字時發生。Occurs when this element gets text in a device-independent manner.

 virtual event System::Windows::Input::TextCompositionEventHandler ^ TextInput;
public event System.Windows.Input.TextCompositionEventHandler TextInput;
member this.TextInput : System.Windows.Input.TextCompositionEventHandler 
Public Custom Event TextInput As TextCompositionEventHandler 




此事件可能已被標示為已處理的複合控制項的內部實作。This event might already be marked as handled by the internal implementations of composited controls. 請參閱下方的備註。See Remark below.

TextInput事件可能已被標示為已處理的複合控制項的內部實作。The TextInput event may already be marked as handled by the internal implementations of composited controls. 例如,TextBox是複合控制項,TextInput事件已標示為已處理,其複合 (compositing) 內。For example, a TextBox is a composited control where the TextInput event is already marked as handled; within its compositing. 控制項執行這項操作,因為控制項必須解譯某些類型的輸入,例如方向鍵,該控制項的特殊意義。Controls do this because the control needs to interpret some types of input, such as arrow keys, as having special meaning to that control. 如果您使用PreviewTextInput做為您用來附加文字輸入的處理常式的事件,您可能會收到更好的結果。If you use PreviewTextInput as the event where you attach handlers for text input, you may receive better results. 這項技術會規避大部分的情況下,其中已將這個事件標記為已處理控制項組合,而收到此事件路由事件時,防止您的處理常式。This technique circumvents most cases where control composition has already marked this event as handled and prevents your handler from receiving the event along the event route.

TextInput事件可讓元件或應用程式以與裝置無關的方式接聽文字輸入。The TextInput event allows a component or application to listen for text input in a device-independent manner. 鍵盤是主要的方法TextInput,但也可以將語音、 手寫和其他輸入的裝置TextInputThe keyboard is the primary means of TextInput, but speech, handwriting, and other input devices can also raise TextInput.

因為索引鍵組合-在預設鍵盤或輸入的法編輯器-透過多個索引鍵的事件可能會引發一個文字輸入的事件。Because of key combinations - either in default keyboards or through input method editors - multiple key events might raise just one text input event.

此事件建立的別名TextCompositionManager.TextInput附加事件,此類別中,以便TextInput屬於類別的成員清單時ContentElement繼承為基底的項目。This event creates an alias for the TextCompositionManager.TextInput attached event for this class, so that TextInput is part of the class members list when ContentElement is inherited as a base element. 附加至事件處理常式TextInput事件會附加至基礎TextCompositionManager.TextInput附加事件,並接收相同的事件資料執行個體。Event handlers that are attached to the TextInput event are attached to the underlying TextCompositionManager.TextInput attached event and receive the same event data instance.

路由事件資訊Routed Event Information

識別項欄位Identifier field TextInputEvent
路由策略Routing strategy 事件反昇Bubbling
Delegate - 委派Delegate TextCompositionEventHandler