Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

TextChangedEventHandler Delegate

Represents the method that will handle the TextBoxBase::TextChanged  routed event.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public delegate void TextChangedEventHandler(
	Object^ sender, 
	TextChangedEventArgs^ e
)

Parameters

sender
Type: System::Object

The object where the event handler is attached.

e
Type: System.Windows.Controls::TextChangedEventArgs

The event data.

This example shows one way to use the TextChanged event to execute a method whenever the text in a TextBox control has changed.

In the code-behind class for the XAML that contains the TextBox control that you want to monitor for changes, insert a method to call whenever the TextChanged event fires. This method must have a signature that matches what is expected by the TextChangedEventHandler delegate.

The event handler is called whenever the contents of the TextBox control are changed, either by a user or programmatically.

Note: This event fires when the TextBox control is created and initially populated with text.

In the Extensible Application Markup Language (XAML) that defines your TextBox control, specify the TextChanged attribute with a value that matches the event handler method name.

<TextBox  TextChanged="textChangedEventHandler">
  Here is the initial text in my TextBox.  Each time the contents of this TextBox are changed, 
  the TextChanged event  fires and textChangedEventHandler is called.
</TextBox>

In the code-behind class for the XAML that contains the TextBox control that you want to monitor for changes, insert a method to call whenever the TextChanged event fires. This method must have a signature that matches what is expected by the TextChangedEventHandler delegate.

No code example is currently available or this language may not be supported.

The event handler is called whenever the contents of the TextBox control are changed, either by a user or programmatically.

Note: This event fires when the TextBox control is created and initially populated with text.

Comments

.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.

Show:
© 2014 Microsoft