Spell Checking Examples
Checking spelling as the user types, walking through a document in the spell check dialog and offering suggestions in a context menu: the samples below show each of these with TX Spell .NET for WPF, in TX Text Control and in the standard text controls of WPF. All WPF samples come with the setup. The repositories on GitHub and the articles of the Text Control Blog were written for Windows Forms or for the TXSpell class, and the list says which.
Samples of the Setup
The setup installs these samples in C# and Visual Basic, below TX Spell 11.0.NET for WPF\Samples\WPF in your Documents folder, in the folder CSharp or VB.NET. Each is a WPF project with a TXSpellChecker.
With TX Text Control
| Example | What it shows | Where |
|---|---|---|
| Simple | A spell checker connected to a TextControl, which marks misspelled words as the user types | TextControl\Simple |
| Context menu | A context menu of your own with the suggestions for a misspelled word, from GetMenuItems | TextControl\Context menu strip |
| Spell check dialog | The SpellCheckDialog of TX Spell .NET, which you can customize, instead of the dialog of TX Text Control | TextControl\SpellCheckDialog |
| Several controls | One TXSpellChecker for several TextControl instances | TextControl\Multiple controls |
| Dialog for several controls | One spell check dialog that walks through four TextControl instances and their text parts, switching controls in SpellCheckDialogClosing | TextControl\SpellCheckDialog on multiple controls |
| Dialog for chosen text parts | Check boxes choose which text parts the dialog checks: the main text, headers, footers and text frames, through the SpellCheckDialogStateManager | TextControl\SpellCheckDialog on specific text parts |
| Correction user interface | A user interface of your own for corrections, bound to the SpellingCorrectionUIProvider, in a simple and an advanced version | TextControl\SpellingCorrectionUIProvider |
With RichTextBox and TextBox
| Example | What it shows | Where |
|---|---|---|
| Spell check dialog | Check finds the misspelled words of a RichTextBox, and the spell check dialog shows them | RichTextBox\SpellCheckDialog |
| Context menu | Suggestions in the context menu of a RichTextBox | RichTextBox\Context menu strip |
| Several controls, as you type | Four RichTextBox controls that share one spell checker: when the text of one changes, Check checks it and the misspelled word at the caret turns red, as As-You-Type Checking shows | Samples of the setup; the documentation names no folder |
| Dialog for several controls | One spell check dialog for four RichTextBox controls | SpellCheckDialog on multiple controls |
| Check simple text | The text of a TextBox, checked on demand with Check of the TXSpellChecker and by a validation rule of the binding | Check simple text |
Getting Started builds the first of these samples step by step.
GitHub Samples
No repository on GitHub is a WPF application with TX Spell .NET. The spell checking Web API and the ASP.NET validation sample use only the TXSpell class, and the AutoCorrect and suggestion samples are Windows Forms applications; GitHub Examples describes them.
Next Steps
- Dictionary and Language Examples: dictionaries, hyphenation, synonyms and language detection.
- Spell Checking: the ways to check spelling, explained.
- Customizing the Spell Check Dialog: change the dialog to fit your application.