TextPattern.TextSelectionChangedEvent 欄位
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
識別修改文字選擇時所引發的事件。
public: static initonly System::Windows::Automation::AutomationEvent ^ TextSelectionChangedEvent;
public static readonly System.Windows.Automation.AutomationEvent TextSelectionChangedEvent;
staticval mutable TextSelectionChangedEvent : System.Windows.Automation.AutomationEvent
Public Shared ReadOnly TextSelectionChangedEvent As AutomationEvent
欄位值
範例
// Initialize a selection changed listener.
// The target selection is reflected in the client.
Automation.AddAutomationEventHandler(
TextPattern.TextSelectionChangedEvent,
targetDocument,
TreeScope.Element,
OnTextSelectionChange);
' Initialize a selection changed listener.
' The target selection is reflected in the client.
Dim onSelectionChanged As AutomationEventHandler = _
New AutomationEventHandler(AddressOf OnTextSelectionChange)
Automation.AddAutomationEventHandler( _
TextPattern.TextSelectionChangedEvent, targetDocument, _
TreeScope.Element, onSelectionChanged)
備註
有些文字控制項將文字插入點(游標)視為零寬度的文字選取,當游標移動時可能會凸起 TextSelectionChangedEvent 。
Note
為了追蹤游標移動,建議使用者介面自動化用戶端透過聆聽對應的使用者介面自動化元素事件來追蹤插入點的變化,而非依賴TextSelectionChangedEvent。
此識別碼由使用者介面自動化用戶端應用程式使用使用者介面自動化提供者應使用TextPatternIdentifiers 中的等效欄位。