TextPattern.TextChangedEvent Field

Identifies the event raised whenever textual content is modified.

Namespace:  System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

public static readonly AutomationEvent TextChangedEvent

This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent field in TextPatternIdentifiers.

// Initialize a text changed listener. 
// An instance of TextPatternRange will become invalid if  
// one of the following occurs: 
// 1) The text in the provider changes via some user activity. 
// 2) ValuePattern.SetValue is used to programatically change  
// the value of the text in the provider. 
// The only way the client application can detect if the text  
// has changed (to ensure that the ranges are still valid),  
// is by setting a listener for the TextChanged event of  
// the TextPattern. If this event is raised, the client needs  
// to update the targetDocumentRange member data to ensure the  
// user is working with the updated text.  
// Clients must always anticipate the possibility that the text  
// can change underneath them.
Automation.AddAutomationEventHandler(
    TextPattern.TextChangedEvent,
    targetDocument,
    TreeScope.Element,
    TextChanged);

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft