RichTextBox
The RichTextBox of WPF doesn't know TX Spell .NET, but TX Spell .NET can check its text. Two short tutorials add it: one marks misspelled words while the user types, the other opens the spell check dialog. Both need only the TX Spell .NET package, not TX Text Control.

How It Works
With TX Text Control, the editor does most of the work. With a RichTextBox, your code does it:
- You pass the text. The Check method of the TXSpellChecker checks the text of the document and lists the incorrect words with their positions in IncorrectWords.
- You find the words in the document. A position in the text is not a position in a
FlowDocument, so a small helper method walks through the document to find each word. - You mark and correct them. The tutorial colors misspelled words red, and the spell check dialog tells your code which word the user changed, through the
IncorrectWordChangingevent.
Recommended Order
- Check Spelling as You Type: create the project, declare the spell checker in XAML, and color misspelled words red while the user types.
- Open the Spell Check Dialog: add a button that opens the dialog, and write each correction back into the document.
For a WPF TextBox, a validation rule checks the text on every change; As-You-Type Checking shows it.
Pages in This Section
- Check Spelling as You Type: a
RichTextBoxthat colors misspelled words. - Open the Spell Check Dialog: the spell check dialog of TX Spell .NET for a
RichTextBox.