RichTextBox
The WPF RichTextBox can be spell checked with TX Spell .NET alone: the package TXTextControl.TXSpell.WPF.SDK is all it takes, and TX Text Control isn't needed. What differs from TX Text Control is who does the work. TX Text Control underlines, corrects and offers its menu by itself; with a RichTextBox, TX Spell .NET finds the mistakes and your code shows and fixes them in the FlowDocument. The tutorials in RichTextBox build each part step by step; here is what the integration consists of, and what to expect from it.
What TX Spell .NET Does and What Your Code Does
| Task | With a RichTextBox |
|---|---|
| Initialize the spell checker | Your code calls Create once; no TextControl does it for you |
| Find misspelled words | Check with the text of the document fills IncorrectWords |
| Mark the words | Your code colors them; there is no wavy underline |
| Offer the dialog | SpellCheckDialog.Show(this) walks the user through the words of the last check |
| Apply a correction | Your code changes the document in the IncorrectWordChanging event |
| Offer a context menu | GetMenuItems creates the items; your code adds them to a ContextMenu |
The spell checker, declared as a resource of the window, works on a string. The text of a RichTextBox is new TextRange(document.ContentStart, document.ContentEnd).Text, and that string is what you pass to Check.
Positions in a FlowDocument
The Start of an IncorrectWord is the zero-based index of its first character in the checked string, not a position in the FlowDocument. To color or replace the word, your code walks the document with TextPointer objects to the same character, counting each paragraph end and line break as Environment.NewLine, the way TextRange.Text writes them. The helpers GetTextPointerAtOffset and GetRange in Check Spelling as You Type do this; the range they return is colored with ApplyPropertyValue(TextElement.ForegroundProperty, Brushes.Red) and replaced by setting its Text.
A TextBox doesn't need this: its character positions are those of its Text, and textBox1.Select(incorrectWord.Start, incorrectWord.Length) selects the word.
Mark Misspelled Words as the User Types
The TextChanged event of the RichTextBox checks the text and colors each incorrect word red:

Because the whole text is checked on every change, a word turns red while it is still being typed, and the check takes longer as the text grows. TX Text Control, by comparison, underlines only completed words. Check Spelling as You Type builds this application.
A TextBox can't color single words, but a validation rule can report mistakes while the user types:

Validate a TextBox as the User Types shows the rule.
Correct in the Dialog
The spell check dialog works with any text: call Check first, then SpellCheckDialog.Show(this) with the window as the owner. When the user changes or deletes a word, IncorrectWordChanging fires, and your code makes the same change in the document. Open the Spell Check Dialog builds this for a RichTextBox, and Check a TextBox in the Dialog explains the arguments of the event.
Several Controls
One spell checker serves any number of controls, which saves memory and time compared to one instance per control. IncorrectWords always holds the result of the last Check, so check each control right before you mark its words. To walk through several controls in one dialog, pass the next text to the dialog in its closing event:

Check Several TextBoxes in One Dialog shows the technique.
Samples
The setup installs samples for each technique, in C# and Visual Basic, below TX Spell 11.0.NET for WPF\Samples\WPF in your Documents folder. Spell Checking Examples lists them.
Next Steps
- Other Controls: the same pattern for labels and other controls.
- Events: the events of the spell checker and their arguments.
- TX Text Control .NET for WPF: the integration that needs no code.
