TX Spell .NET for WPF

TX Text Control .NET for WPF

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 key of the spell checker resource, a string, not the object: SpellChecker="txSpellChecker1" in XAML. The connection also initializes the spell checker, so you don't call its Create method. Create Your First WPF Application shows the steps, and Checking Multiple Controls how several editors share one spell checker.

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 in one window 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 WPF 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
SpellCheckContextMenuThe 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, connected through the RibbonProofingTab property of the TextControlHyphenation with TX Text Control, 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 changes the text of a misspelled word to 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. With TX Spell .NET connected, use the spell checker instead.

Next Steps