TX Spell .NET for Windows Forms

Spell Checking Examples

Topic

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 Windows Forms, in TX Text Control and in the standard text controls of Windows Forms. Most of them come with the setup; the others are repositories on GitHub and articles of the Text Control Blog.

Samples of the Setup

The setup installs these samples in C# and Visual Basic, below TX Spell 11.0.NET for Windows Forms\Samples\WinForms in your Documents folder, in the folder CSharp or VB.NET. Each is a Windows Forms project with a TXSpellChecker component on the form.

With TX Text Control

ExampleWhat it showsWhere
SimpleA spell checker connected to a TextControl, which marks misspelled words as the user typesTextControl\Simple
Context menuA context menu of your own with the suggestions for a misspelled word, from GetMenuItemsTextControl\Context menu strip
Spell check dialogThe SpellCheckDialog of TX Spell .NET, which you can customize, instead of the dialog of TX Text ControlTextControl\SpellCheckDialog
Several controlsOne TXSpellChecker for several TextControl instancesTextControl\Multiple controls
Dialog for several controlsOne spell check dialog that walks through four TextControl instances and their text parts, switching controls in SpellCheckDialogClosingTextControl\SpellCheckDialog on multiple controls
Dialog for chosen text partsCheck boxes choose which text parts the dialog checks: the main text, headers, footers and text frames, through the SpellCheckDialogStateManagerTextControl\SpellCheckDialog on specific text parts
Correction user interfaceA user interface of your own for corrections, bound to the SpellingCorrectionUIProvider, in a simple and an advanced versionTextControl\SpellingCorrectionUIProvider
Modified dialogButtons added to, removed from and changed in the spell check dialog through its DialogButtonCollection, another font and an options dialog of your ownModify SpellCheckDialog

With RichTextBox and TextBox

ExampleWhat it showsWhere
Spell check dialogCheck finds the misspelled words of a RichTextBox, and the spell check dialog shows themRichTextBox\SpellCheckDialog
Context menuSuggestions in the context menu of a RichTextBoxRichTextBox\Context menu strip
Several controlsOne spell checker for several RichTextBox controls, which checks each one when its text changesRichTextBox\Multiple controls
Dialog for several controlsOne spell check dialog for four RichTextBox controlsRichTextBox\SpellCheckDialog on multiple controls
Check simple textThe text of a TextBox, checked on demand with Check of the TXSpellChecker and when the control is validatedCheck simple text

Getting Started builds the first of these samples step by step.

GitHub Samples

Three repositories on GitHub show spell checking beyond the samples of the setup: AutoCorrect of two initial capitals and interactive suggestions below a misspelled word in TX Text Control, and the validation of a form field in ASP.NET Web Forms with the TXSpell class. The Repositories describes them with the versions they were written for, and shows how to update an older one.

Blog Articles With Code

These articles contain their code, without a repository. They were written for earlier versions; check the members they use in the reference:

ExampleWhat it showsWhere
AutoCorrectA misspelled word replaced with its first suggestion when the user types a delimiterAutoCorrect Using TX Text Control and TX Spell .NET
AutoText and AutoCorrect on a keyAbbreviations that TX Spell .NET reports as misspelled replaced with their full text from the Changed event, and the misspelled word at the input position replaced with its first suggestion when the user presses Ctrl+Space, both through MisspelledWordCollection.RemoveImplementing AutoText with TX Text Control and TX Spell .NET
One spell checker for several editorsA single TXSpellChecker shared by several TextControl instancesShare a Single TXSpellChecker Instance Across Multiple TextControls
Custom context menusThe context menu of misspelled words in TX Text Control, built by your own codeTX Spell .NET: Creating Custom Context Menus
Spell checking without a user interfaceTXSpell connected to a ServerTextControl, which processes documents without a user interfaceUsing TX Spell .NET with ServerTextControl

Next Steps