UIElement.PreviewTextInput 事件

定義

此元素以一種與裝置無關的方式取得文字時發生。

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

事件類型

實作

備註

事件 PreviewTextInput 可讓元件或應用程式以與裝置無關的方式接聽文字輸入。 鍵盤是 的主要方式 PreviewTextInput ;但語音、手寫和其他輸入裝置也可以產生 PreviewTextInput

由於按鍵組合 - 在預設鍵盤或透過輸入法編輯器 - 多個按鍵事件可能會只引發一個文字輸入事件。

這個事件會為此 TextCompositionManager.PreviewTextInput 類別建立附加事件的別名,以便在 PreviewTextInput 繼承為基底專案時 UIElement 屬於類別成員清單的一部分。 附加至 PreviewTextInput 事件的事件處理常式會附加至基礎 TextCompositionManager.PreviewTextInput 附加事件,並接收相同的事件資料實例。

路由事件資訊

識別碼欄位 PreviewTextInputEvent
路由策略 隧道
代理人 TextCompositionEventHandler

適用於

另請參閱