# Events

> Connect TextControl events in XAML or code, see how they differ from routed events, track unsaved changes and find every WPF TextControl event by subject.

- **Product:** TX Text Control .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET for WPF > Document Editor > Events
- **4569 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/events/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/events/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/events/llms-full.txt

---

The WPF `TextControl` has two kinds of events. Those it inherits from `System.Windows.Controls.Control`, such as `Loaded`, `KeyDown` or `GotFocus`, are WPF routed events. The more than 130 events that TX Text Control adds, from `Changed` to `TrackedChangeCreated`, are ordinary .NET events of the control. Both kinds are connected in XAML or in code. Here is how, followed by the events grouped by subject and two common features built from them.

Everything below builds on a window with a `TextControl` named `textControl1` in *MainWindow.xaml*, as in [Create Your First WPF Application](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-editor/first-application/llms-full.txt).

### How the Events Work

A handler receives `sender`, the `TextControl`, and an argument with the details of the event:

- [Changed](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/changed-event/llms-full.txt), [InputPositionChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/inputpositionchanged-event/llms-full.txt), [PageChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pagechanged-event/llms-full.txt) and many others pass a plain `EventArgs`; the handler reads the current state from the control.
- Events about an object pass an argument class that contains it, such as [TrackedChangeEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/trackedchangeeventargs/llms-full.txt) or [ImageEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/imageeventargs/llms-full.txt). These classes are in the `TXTextControl` namespace, which the WPF product shares with the other TX Text Control products.
- A few argument classes let the handler decide what the editor does, for example [CannotTrackChangeEventArgs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/cannottrackchangeeventargs/llms-full.txt) with `Cancel` and `Handled`.

Because the events of TX Text Control aren't routed events, they don't bubble up to the window: connect them on the `TextControl` itself.

### Connect an Event Handler

Name the handler in an attribute of the `TextControl` element in *MainWindow.xaml*. Visual Studio offers to create the method in *MainWindow.xaml.cs*:

```xml
<WPF:TextControl x:Name="textControl1"
                Loaded="TextControl1_Loaded"
                Changed="TextControl1_Changed"
                DocumentLoaded="TextControl1_DocumentLoaded"
                ContentsReset="TextControl1_ContentsReset"
                InputPositionChanged="TextControl1_InputPositionChanged" />
```

In code, connect a handler with `+=` and disconnect it with `-=`, for example `textControl1.Changed += TextControl1_Changed;` in the constructor after `InitializeComponent`. `Loaded` is the WPF event that signals that the control is ready: put code that works with the document there, such as loading a file.

### Track Unsaved Changes

[Changed](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/changed-event/llms-full.txt) occurs when the contents of the document have changed, [DocumentLoaded](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/documentloaded-event/llms-full.txt) when a document has been loaded, and [ContentsReset](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/contentsreset-event/llms-full.txt) when all contents have been deleted and reset. With the handlers of the XAML above, they keep a flag up to date:

```csharp
private bool documentModified;

private void TextControl1_Changed(object sender, EventArgs e)
{
    documentModified = true;
}

private void TextControl1_DocumentLoaded(object sender, EventArgs e)
{
    // A freshly loaded document has no unsaved changes
    documentModified = false;
}

private void TextControl1_ContentsReset(object sender, EventArgs e)
{
    documentModified = false;
}
```

The handlers of TX Text Control events take an `EventArgs`, the `Loaded` handler a `RoutedEventArgs`. Reset the flag after your code has saved the document, too. [Load and Save Documents](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/getting-started/document-editor/load-save/#write-the-commands) in Getting Started uses such a flag to ask about unsaved changes before **New**, **Open** and closing the window, where the `Closing` handler sets `e.Cancel` to keep the window open.

### Show the Position of the Caret

[InputPositionChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/inputpositionchanged-event/llms-full.txt) occurs after each move of the input position. The following handler writes the line and column into a `TextBlock` named `positionText`:

```csharp
private void TextControl1_InputPositionChanged(object sender, EventArgs e)
{
    InputPosition position = textControl1.InputPosition;
    positionText.Text = $"Line {position.Line}, column {position.Column}";
}
```

[CharFormatChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/charformatchanged-event/llms-full.txt) and [ParagraphFormatChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/paragraphformatchanged-event/llms-full.txt) report changed formatting at the input position or in the selection, for example to update a toggle button of your own from [Selection.Bold](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol/selection/bold-property/llms-full.txt). The status bar of TX Text Control shows the position without code; see [Rulers and Status Bar](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/rulers-status-bar/llms-full.txt).

### Events by Subject

Object events come in families of created, deleted, selected, clicked, moved and sized:

| Subject | Events | Read |
|---|---|---|
| Documents | [Changed](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/changed-event/llms-full.txt), [DocumentLoaded](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/documentloaded-event/llms-full.txt), [ContentsReset](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/contentsreset-event/llms-full.txt), [PageFormatChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pageformatchanged-event/llms-full.txt) | [Loading and Saving Documents](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/load-save/llms-full.txt) |
| Input position | [InputPositionChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/inputpositionchanged-event/llms-full.txt), [InputParagraphChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/inputparagraphchanged-event/llms-full.txt), [PageChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/pagechanged-event/llms-full.txt), [SectionChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/sectionchanged-event/llms-full.txt), [MainTextActivated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/maintextactivated-event/llms-full.txt) | [Selections and Caret Position](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/editing-text/selections/llms-full.txt) |
| Formatting | [CharFormatChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/charformatchanged-event/llms-full.txt), [ParagraphFormatChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/paragraphformatchanged-event/llms-full.txt), [InputFormattingStyleChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/inputformattingstylechanged-event/llms-full.txt), [FormattingStyleChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formattingstylechanged-event/llms-full.txt), [FormattingStyleListChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formattingstylelistchanged-event/llms-full.txt) | [Text and Paragraph Formatting](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/formatting/llms-full.txt), [Stylesheets](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/stylesheets/llms-full.txt) |
| Tables | [TableCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tablecreated-event/llms-full.txt), [TableDeleted](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tabledeleted-event/llms-full.txt), [TableFormatChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableformatchanged-event/llms-full.txt) | [Tables and Table Formulas](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/tables/llms-full.txt) |
| Images | [ImageCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/imagecreated-event/llms-full.txt), [ImageClicked](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/imageclicked-event/llms-full.txt), [ImageSelected](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/imageselected-event/llms-full.txt) and the other `Image...` events | [Images](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/images/llms-full.txt) |
| Text frames and drawings | [TextFrameCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textframecreated-event/llms-full.txt), [TextFrameActivated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textframeactivated-event/llms-full.txt), [DrawingCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/drawingcreated-event/llms-full.txt) and the other `TextFrame...` and `Drawing...` events | [Text Frames and Shapes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/text-frames-shapes/llms-full.txt) |
| Barcodes | [BarcodeCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/barcodecreated-event/llms-full.txt), [BarcodeClicked](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/barcodeclicked-event/llms-full.txt) and the other `Barcode...` events | [Charts and Barcodes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/charts-barcodes/llms-full.txt) |
| All frames | [FrameClicked](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/frameclicked-event/llms-full.txt), [FrameSelected](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/frameselected-event/llms-full.txt), [FrameDeselected](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/framedeselected-event/llms-full.txt), [FrameMoved](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/framemoved-event/llms-full.txt), [FrameSized](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/framesized-event/llms-full.txt) and the other `Frame...` events, for images, text frames, barcodes and drawings alike | [Images](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/images/llms-full.txt), [Built-in Ribbon Tabs](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/ribbon/#show-tabs-only-in-context) |
| Headers and footers | [HeaderFooterActivated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/headerfooteractivated-event/llms-full.txt), [HeaderFooterDeactivated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/headerfooterdeactivated-event/llms-full.txt) | [Headers and Footers](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/headers-footers/llms-full.txt) |
| Footnotes | [FootnoteCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/footnotecreated-event/llms-full.txt), [FootnoteDeleted](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/footnotedeleted-event/llms-full.txt) and the other `Footnote...` events | [Footnotes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/footnotes/llms-full.txt) |
| Tables of contents | [TableOfContentsCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentscreated-event/llms-full.txt), [TableOfContentsEntered](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/tableofcontentsentered-event/llms-full.txt) and the other `TableOfContents...` events | [Tables of Contents](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/tables-of-contents/llms-full.txt) |
| Fields, links and bookmarks | [TextFieldClicked](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textfieldclicked-event/llms-full.txt), [TextFieldEntered](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textfieldentered-event/llms-full.txt), [HypertextLinkClicked](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/hypertextlinkclicked-event/llms-full.txt), [DocumentLinkClicked](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/documentlinkclicked-event/llms-full.txt), [DocumentTargetCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/documenttargetcreated-event/llms-full.txt) and the other `TextField...` events | [Fields, Hyperlinks, and Bookmarks](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/fields/llms-full.txt) |
| Subtext parts | [SubTextPartCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/subtextpartcreated-event/llms-full.txt), [SubTextPartEntered](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/subtextpartentered-event/llms-full.txt) and the other `SubTextPart...` events | [Subtext Parts](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/subtext-parts/llms-full.txt) |
| Form fields | [FormFieldTextChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formfieldtextchanged-event/llms-full.txt), [FormFieldCheckChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formfieldcheckchanged-event/llms-full.txt), [FormFieldSelectionChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formfieldselectionchanged-event/llms-full.txt), [FormFieldDateChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formfielddatechanged-event/llms-full.txt), [FormFieldSettingsChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/formfieldsettingschanged-event/llms-full.txt) | [Form Fields and Conditional Instructions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/form-fields/llms-full.txt) |
| Signature fields | [SignatureFieldCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/signaturefieldcreated-event/llms-full.txt), [SignatureFieldClicked](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/signaturefieldclicked-event/llms-full.txt) and the other `SignatureField...` events | [Signature Fields](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/signature-fields/llms-full.txt) |
| Tracked changes | [TrackedChangeCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/trackedchangecreated-event/llms-full.txt), [TrackedChangeDeleted](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/trackedchangedeleted-event/llms-full.txt), [TrackedChangeChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/trackedchangechanged-event/llms-full.txt), [TrackedChangeStateChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/trackedchangestatechanged-event/llms-full.txt), [CannotTrackChange](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/cannottrackchange-event/llms-full.txt) | [Track Changes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/track-changes/llms-full.txt) |
| Comments | [CommentCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/commentcreated-event/llms-full.txt), [CommentDeleted](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/commentdeleted-event/llms-full.txt), [CommentChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/commentchanged-event/llms-full.txt), [CommentStateChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/commentstatechanged-event/llms-full.txt), [CommentedTextEntered](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/commentedtextentered-event/llms-full.txt), [CommentedTextLeft](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/commentedtextleft-event/llms-full.txt) | [Comments](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/comments/llms-full.txt) |
| Editable regions | [EditableRegionCreated](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/editableregioncreated-event/llms-full.txt), [EditableRegionDeleted](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/editableregiondeleted-event/llms-full.txt), [EditableRegionEntered](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/editableregionentered-event/llms-full.txt), [EditableRegionLeft](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/editableregionleft-event/llms-full.txt) | [Document Protection and Editable Regions](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/protection/llms-full.txt) |
| Spelling and hyphenation | [SpellCheckText](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellchecktext-event/llms-full.txt), [HyphenateWord](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/hyphenateword-event/llms-full.txt) | [Spell Checking and Hyphenation](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/spell-checking/llms-full.txt) |
| View | [HScroll](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/hscroll-event/llms-full.txt), [VScroll](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/vscroll-event/llms-full.txt), [HExpanded](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/hexpanded-event/llms-full.txt), [VExpanded](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/vexpanded-event/llms-full.txt), [HShrunk](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/hshrunk-event/llms-full.txt), [VShrunk](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/vshrunk-event/llms-full.txt) | [Viewing, Zooming, and Navigation](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/viewing/llms-full.txt) |
| Menus and toolbars | [TextContextMenuOpening](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textcontextmenuopening-event/llms-full.txt), [MiniToolbarOpening](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/minitoolbaropening-event/llms-full.txt), [TextMiniToolbarInitialized](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/textminitoolbarinitialized-event/llms-full.txt), [ObjectMiniToolbarInitialized](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/objectminitoolbarinitialized-event/llms-full.txt) | [Context Menus](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/context-menus/llms-full.txt), [Toolbars and Mini Toolbars](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/toolbars/llms-full.txt) |
| Fonts and XML | [AdaptFont](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/adaptfont-event/llms-full.txt), [XmlInvalid](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/xmlinvalid-event/llms-full.txt), [XmlNotWellFormed](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/xmlnotwellformed-event/llms-full.txt) | The reference pages of the events |

In the assembly of version 34.0, the two mini toolbar events are compiled as `TextMiniToolbarInitalized` and `ObjectMiniToolbarInitalized`, without the second "i"; attach handlers with these names, as [Toolbars and Mini Toolbars](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/toolbars/llms-full.txt) explains.

Compared with the Windows Forms control, the WPF `TextControl` has no `Zoomed` event and no `Chart...` events. To follow the zoom factor, bind to the `ZoomFactor` dependency property, as [Viewing, Zooming, and Navigation](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/viewing/llms-full.txt) shows.

### Handle Events in a Derived Control

Each event has a protected method that raises it, `On` followed by the event name, for example [OnChanged](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/onchanged-method/llms-full.txt). A class derived from the WPF `TextControl` overrides it and calls the base method, which raises the event for the connected handlers:

```csharp
using System;

public class AuditTextControl : TXTextControl.WPF.TextControl
{
    public DateTime LastChange { get; private set; }

    protected override void OnChanged(EventArgs e)
    {
        LastChange = DateTime.Now;

        // Raise the Changed event for the connected handlers
        base.OnChanged(e);
    }
}
```

### Next Steps

- [Architecture and Control Lifecycle](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/architecture/llms-full.txt): when the control is ready and how it is set up.
- [Selections and Caret Position](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/editing-text/selections/llms-full.txt): the input position that many events report.
- [Track Changes](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/track-changes/llms-full.txt) and [Comments](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/comments/llms-full.txt): events of a review workflow in use.
- [TextControl](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/overview/components/textcontrol/llms-full.txt): the members of the editor at a glance.

---

## Nearby

- **Previous:** [Right-to-Left UI](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-editor/ribbon-ui/right-to-left/llms-full.txt)
- **Next:** [Document Processing](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/document-processing/llms-full.txt)
