# Events

The [.NET MAUI RichTextEditor](https://www.telerik.com/maui-ui/documentation/controls/richtexteditor/overview) emits a set of events that allow you to configure the component's behavior in response to specific user actions.

The RichTextEditor component exposes the following events:

* `OpenHyperlinkError`—Raised when users try to open invalid URLs in the editor. The `OpenHyperlinkError` event handler receives two parameters:

  * The `Sender`, which is the RichTextEditor control;
  * `OpenHyperlinkErrorEventArgs`, which provides the following properties:
    * `Error`—of type `System.Exception`; can be used to get the exact error message;
    * `Url`—of type string; defines the URL of the hyperlink;
    * `Handled`—a boolean property indicating whether the event is handled.

* `IsReadOnlyChanged`—Raised when read-only mode of the RichTextEditor is switched. The `IsReadOnlyChanged` event receives two parameters:

  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<bool>`—provides the `NewValue` and `OldValue` properties of type `bool`, indicating the `IsReadOnly` property change.

* `FontFamilyChanged`—Raised when the `FontFamily` property of the RichTextEditor is modified. The `FontFamilyChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<string>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `FontSizeChanged`—Raised when the `FontSize` property of the RichTextEditor is modified. The `FontSizeChanged` event handler receives two parameters:
  * The <code>Sender</code>, which is the RichTextEditor control;
  * `ValueChangedEventArgs<RichTextUnit>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `FontAttributesChanged`—Raised when the `FontAttributes`, such as bold, italic, subscript and superscript is modified. The `FontAttributesChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<RichTextFontAttributes>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `TextDecorationsChanged`—Raised when the `TextDecorations`, such as underline and strike through is modified. The `TextDecorationsChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<RichTextDecorations>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `TextFormattingChanged`—Raised when the `TextFormatting`, such as heading, paragraph or quotation is modified. The `TextFormattingChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<RichTextFormatting>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `HorizontalTextAlignmentChanged`—Raised when the `HorizontalTextAlignment`, such as left, right, center or justify is modified. The `HorizontalTextAlignmentChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<RichTextHorizontalAlignment>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `ListTypeChanged`—Raised when the `ListType`, such as numbered or bulleted list is modified. The `ListTypeChanged` event handler receives two parameters:
  * The <code>Sender</code>, which is the RichTextEditor control;
  * `ValueChangedEventArgs<RichTextListType>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `TextColorChanged`—Raised when the `TextColor` property of the RichTextEditor is updated. The `TextColorChanged` event handler receives two parameters:
  * The <code>Sender</code>, which is the RichTextEditor control;
  * `ValueChangedEventArgs<Color>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `HighlightTextColorChanged`—Raised when the `HighlightTextColor` property of the RichTextEditor is updated. The `HighlightTextColorChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<Color>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `SelectionRangeChanged`—Raised when the `SelectionRange`, which defines the start and end position of the currently selected inside the editor text, is updated. The `SelectionRangeChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<RichTextSelectionRange>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `IsHyperlinkSelectedChanged`—Raised when a hyperlink inside the editor is selected. The `IsHyperlinkSelectedChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<bool>` provides the `NewValue` and `PreviousValue` properties of type `TValue`.

* `IsImageSelectedChanged`—Raised when an image inside the editor is selected. The `IsImageSelectedChanged` event handler receives two parameters:
  * The `Sender`, which is the RichTextEditor control;
  * `ValueChangedEventArgs<bool>` provides the `NewValue` and `PreviousValue`.

## See Also

* [Commands](https://www.telerik.com/maui-ui/documentation/controls/richtexteditor/commands)
* [Configure the RichTextEditor](https://www.telerik.com/maui-ui/documentation/controls/richtexteditor/configuration)
* [Working with images](https://www.telerik.com/maui-ui/documentation/controls/richtexteditor/working-with-images/overview)
* [Hyperlinks](https://www.telerik.com/maui-ui/documentation/controls/richtexteditor/hyperlink-support)
