RichTextBox.ContentChanged Event
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Occurs when the content changes in a RichTextBox.
Namespace: System.Windows.Controls
Assembly: System.Windows (in System.Windows.dll)
Syntax
'Declaration
Public Event ContentChanged As ContentChangedEventHandler
public event ContentChangedEventHandler ContentChanged
<RichTextBox ContentChanged="eventHandler"/>
Remarks
The following actions trigger the ContentChanged event:
User input.
Modifying the Blocks collection by adding or removing blocks.
Formatting changes using ApplyPropertyValue.
Inserting, adding, or removing inlines through an InlineCollection in the document.
Calling TextSelection.Text, TextSelection.Insert, TextSelection.Xaml, or TextSelection.ApplyPropertyValue.
Changing Run.Text.
Changes to any of the following properties of RichTextBox or a TextElement inside it: FontSize, FontFamily, Foreground, FontWeight, FontStyle and FontStretch.
Changes to TextDecorations of an inline inside the RichTextBox.
Changes to TextAlignment of a block inside the RichTextBox.
Changes to the following Hyperlink properties on a hyperlink inside the RichTextBox: TargetName, NavigateUri, MouseOverForeground, and MouseOverTextDecorations.
If the Blocks property is set to the same object instance as the existing content in the RichTextBox, the event is not raised.
Version Information
Silverlight
Supported in: 5, 4
Silverlight for Windows Phone
Supported in: Windows Phone OS 7.1
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.