# Spell Checking

> Fix spell checking in WPF: words left unmarked, IgnoreCase and IgnoreWord errors, calls that throw while the dialog is open, Create and the Document Editor.

- **Product:** TX Spell .NET for WPF
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Spell .NET for WPF > Troubleshooting > Spell Checking
- **1612 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/spell-checking/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/spell-checking/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/spell-checking/llms-full.txt

---

The spell checker is connected and its dictionaries are found, yet a misspelled word stays unmarked, or a call of TX Spell .NET for WPF throws an exception. Such problems come from the rules of the spell checker rather than from its installation: which words it checks, when TX Text Control asks it, and which calls it refuses while a dialog is open. When no word is marked at all, start with [Spell Checking Doesn't Start](https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/toolbox/#spell-checking-doesn-t-start) and [Dictionaries Not Found](https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/dictionaries/llms-full.txt).

### A Word Isn't Underlined While You Type It

In a `TextControl`, the word you are typing isn't underlined, although it is misspelled. It is underlined only after you type a space.

Since version 29.0 (X19) of TX Text Control, a word is checked once it is complete, for example when a space or a period follows it. This is the intended behavior, not an error: type a delimiter or click elsewhere, and the word is underlined. [How As-You-Type Checking Works](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/as-you-type/#how-as-you-type-checking-works) describes when words are checked.

### Some Misspelled Words Aren't Marked

Most misspelled words are marked, but some are not: words in capitals such as "NASA", words with digits such as "R2D2", e-mail addresses or URLs.

The spell checker skips these words by default: [IgnoreWord](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/ignoreword-property/llms-full.txt) and [IgnoreCase](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/ignorecase-property/llms-full.txt) leave out words in capitals, words with numbers, e-mail addresses and URLs, and find a capitalized word under its lowercase form. A word is also not marked when the user chose **Ignore All** for it, or added it to a user dictionary with **Add To Dictionary**.

1. To check every word, set `IgnoreWord` to `TXSpell.IgnoreWordSettings.Never`, and to check capitalization strictly, `IgnoreCase` to `TXSpell.IgnoreCaseSettings.Never`. [Ignore Settings](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/ignore-settings/llms-full.txt) lists every value, and users change them on the **Spell Checking Options** tab of the [Options Dialog](https://docs.textcontrol.com/tx-spell-dotnet-wpf/user-interface/options-dialog/#the-spell-checking-options-tab).
2. Look for the word in the user dictionaries of the application, and remove it there if it doesn't belong; see [User Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/dictionaries/user/llms-full.txt).

### Setting IgnoreCase or IgnoreWord Throws an Exception

Assigning a combination of values to `IgnoreCase` or `IgnoreWord` throws an exception.

Not every combination of the flags is valid: in `IgnoreCase`, use at most one of `Always`, `Never`, `WordBegin` and `WordBeginUpper`, and in `IgnoreWord`, use `Never` alone. [Choose How Case Is Handled](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/ignore-settings/#choose-how-case-is-handled) and [Choose Which Words Are Not Checked](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/ignore-settings/#choose-which-words-are-not-checked) give the rules.

### A Call Throws While the Spell Check Dialog Is Open

A method of the spell checker throws an exception when your code calls it, for example from an event handler or a button that the user clicks while the spell check dialog is shown.

Some methods refuse to run while the [SpellCheckDialog](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/spellcheckdialog/llms-full.txt) is open:

| Method | Throws while the dialog is open |
|---|---|
| [TXSpellChecker.Check](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/check-method/llms-full.txt) | Always |
| [DictionaryCollection.Add](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionarycollection/add-method/llms-full.txt) and [Remove](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionarycollection/remove-method/llms-full.txt) | Except for a `UserDictionary` added or removed in the options dialog that a button of the spell check dialog opened |
| [DialogButtonCollection.Add](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/dialogbuttoncollection/add-method/llms-full.txt), [AddRange](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/dialogbuttoncollection/addrange-method/llms-full.txt) and [Remove](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/dialogbuttoncollection/remove-method/llms-full.txt) | Always |

1. Load dictionaries and add or remove dialog buttons before the dialog is shown, for example when the window loads.
2. Call `Check` before you open the dialog or after it is closed.

[Loading and Managing Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/dictionaries/managing/llms-full.txt) and [Customizing the Spell Check Dialog](https://docs.textcontrol.com/tx-spell-dotnet-wpf/user-interface/customizing-dialog/llms-full.txt) show where these calls belong.

### OptionsDialog Throws an ArgumentException

Opening the options dialog with the list of tabs to show throws an `ArgumentException`.

The overloads of [OptionsDialog](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/optionsdialog-method/llms-full.txt) that take `activeTabs` need at least one tab index. Pass an array with at least one index, such as `new int[] { 0 }`, or call `OptionsDialog()` without `activeTabs` to show all tabs. [Show Only Some Tabs](https://docs.textcontrol.com/tx-spell-dotnet-wpf/user-interface/options-dialog/#show-only-some-tabs) lists the indices.

### The Spell Checker Isn't Initialized Without TX Text Control

A `TXSpellChecker` that checks a `RichTextBox`, a `TextBox` or text in code doesn't work as the samples show, while the same spell checker works with a `TextControl`.

[Create](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/create-method/llms-full.txt) initializes the resources of the spell checker and must be called before it is used. A connected `TextControl` calls it for you, and then it must not be called again. Without a `TextControl`, nothing calls it. The same applies to a [TXSpell](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/txspell/llms-full.txt) object, whose [Create](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/txspell/create-method/llms-full.txt) comes first as well.

1. Get the spell checker from the resources of the window with `FindResource`, and call its `Create()` method once, in the constructor of the window after `InitializeComponent`, when no `TextControl` is connected to it.
2. Don't call it for a spell checker that the `SpellChecker` property of a `TextControl` refers to.

[Check Spelling as You Type](https://docs.textcontrol.com/tx-spell-dotnet-wpf/getting-started/richtextbox/as-you-type/llms-full.txt) shows the call in a complete window.

### The Document Editor Doesn't Mark Misspelled Words

In the Document Editor of TX Text Control .NET Server, no word is underlined, although the text contains misspelled words.

The editor checks spelling with `TXTextControl.TXSpell.Core.SDK`, which must be installed in the ASP.NET Core application that hosts the backend. Spell checking is off in the editor by default, and [getIsSpellCheckingEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/getisspellcheckingenabled-method/llms-full.txt) returns `true` after it is switched on, even when no spell checker is present.

1. Install `TXTextControl.TXSpell.Core.SDK` in the project that hosts the Document Editor backend, and rebuild it.
2. Switch spell checking on with [setIsSpellCheckingEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/javascript/txtextcontrol/setisspellcheckingenabled-method/llms-full.txt), or with **Enable Spell Checking** on the **Proofing** tab.
3. For text in another language than US English, add its dictionary to the *Dictionaries* folder of the project.

[TX Text Control .NET Server Document Editor](https://docs.textcontrol.com/tx-spell-dotnet-wpf/integration/document-editor/#check-that-tx-spell-net-is-found) describes the setup.

### Related Pages

- [Ignore Settings](https://docs.textcontrol.com/tx-spell-dotnet-wpf/spell-checking/ignore-settings/llms-full.txt): the words the spell checker skips.
- [Toolbox and Designer](https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/toolbox/llms-full.txt): a spell checker that isn't connected to the `TextControl`.
- [Dictionaries Not Found](https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/dictionaries/llms-full.txt): missing language data and wrong languages.

---

## Nearby

- **Previous:** [Deployment](https://docs.textcontrol.com/tx-spell-dotnet-wpf/troubleshooting/deployment/llms-full.txt)
- **Next:** [Examples](https://docs.textcontrol.com/tx-spell-dotnet-wpf/examples/llms-full.txt)
