TX Spell .NET for Windows Forms

TX Text Control .NET for Windows Forms

Topic

TX Spell .NET was designed as the spell checker of TX Text Control, and the two work together through a handful of properties of the TextControl. Once the spell checker is connected, TX Text Control underlines misspelled words, offers its context menu and dialog, hyphenates, detects languages and opens its thesaurus, all without code. Here is the map of that integration: which member of TX Text Control does what with TX Spell .NET, and which page describes it.

The Connection

One property connects the two products: SpellChecker of the TextControl names the spell checker. The property holds the TXSpellChecker itself: set it in the Properties window or in code. The connection also initializes the spell checker, so you don't call its Create method. Create Your First Windows Forms Application shows the steps, and Checking Multiple Controls how several editors share one spell checker.

In the designer, the SpellChecker property of the TextControl offers the spell checker of the form in its drop-down:

The Properties window of textControl1 with the drop-down of the SpellChecker property open, offering (none) and txSpellChecker1.

From then on, the editor underlines misspelled words and opens the spell check menu with a right-click, here in four editors that share one spell checker:

Four TextControls on one form, each with red underlines, and the context menu of a misspelled word with suggestions, Ignore, Ignore All, Add to Dictionary, Spell Check Dialog and Options.

The two products are installed and licensed separately. TX Spell .NET 11.0 was released together with TX Text Control 33.0, and this documentation uses it with TX Text Control .NET for Windows Forms 34.0. Plan upgrades of both together, as Update Together With TX Text Control describes.

What Each Member Does

Member of TX Text ControlWith TX Spell .NETRead
IsSpellCheckingEnabledUnderlines misspelled words as the user typesAs-You-Type Checking
SpellCheckContextMenuStripThe menu of a right-click on a misspelled word: the built-in one, none or your ownContext Menus
SpellCheckDialogOpens the preconfigured spelling dialog of TX Text ControlChecking on Demand
MisspelledWordsThe misspelled words of the text part with the input focusIncorrect Words and Suggestions
TextPartsThe main text, headers, footers and text frames, each with its misspelled wordsChecking Text Parts
IsHyphenationEnabled and HyphenateWordHyphenates the last word of a line, and lets your code change whereHyphenation with TX Text Control
IsLanguageDetectionEnabledDetects a language for all text with a neutral languageLanguage Detection
LanguageDialogSets the language of the selected text, which decides the dictionariesMultilingual Documents and Language Scopes
ThesaurusDialogThe Thesaurus Dialog, with synonyms for the selected wordSynonyms in the Context Menu
TextContextMenuOpeningLets your code extend a context menu, for example with synonymsSynonyms in the Context Menu
RibbonProofingTabThe Proofing tab of the ribbon: spell checking, hyphenation, thesaurus, dictionaries, languageOpen the Spell Check Dialog, Synonym Lists

The misspelled words of TX Text Control are MisspelledWord objects. Besides the members the pages above describe, the MisspelledWordCollection has an Ignore method, which replaces the text of a misspelled word with the text you pass and marks it as ignored, so that it loses its underline, and the enumeration MisspelledWordKind filters the collection by normal, duplicate and ignored words.

Members of TX Spell .NET for TX Text Control

Some members of TX Spell .NET take a TextControl or its misspelled words:

Minimum Versions

TX Text Control 17.0 introduced the connection: the SpellChecker property, the spell check dialog and the context menu of misspelled words. The other features followed with the TX Spell .NET version that brought them. Current versions support all of them:

FeatureTX Text ControlTX Spell .NET
Hyphenation20.04.0
Language detection21.05.0
Thesaurus25.07.0

Another Spell Checker

The event SpellCheckText of the TextControl passes each piece of text to check to your code, which returns the misspelled words; it is the hook for a spell checker other than TX Spell .NET. It is raised only when no spell checker is connected: with TX Spell .NET, TX Text Control handles it internally.

Next Steps