# Spell Checking

> Fix unmarked words, ignore settings and exceptions of Check or OptionsDialog in Windows Forms, plus SpellCheckText, Create and the Document Editor.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Spell .NET for Windows Forms > Troubleshooting > Spell Checking
- **1978 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/troubleshooting/spell-checking/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/troubleshooting/spell-checking/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/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 Windows Forms 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-winforms/troubleshooting/toolbox/#spell-checking-doesn-t-start) and [Dictionaries Not Found](https://docs.textcontrol.com/tx-spell-dotnet-winforms/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: when a delimiter such as a space or a period follows it, when the input position moves elsewhere, or when the document loses the focus. Earlier versions marked a word while it was still being typed. This is the intended behavior, not an error.

1. Type a space or a period after the word, or click elsewhere in the document.
2. Check that the word is underlined now.

[As-You-Type Checking](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/as-you-type/llms-full.txt) shows both behaviors side by side.

### 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, as [What the Spell Checker Skips by Default](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/ignore-settings/#what-the-spell-checker-skips-by-default) describes. The defaults of [IgnoreWord](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/ignoreword-property/llms-full.txt) and [IgnoreCase](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/ignorecase-property/llms-full.txt) can also be changed by users, on the **Spell Checking Options** tab of the options dialog.

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`:

```csharp
txSpellChecker1.IgnoreWord = TXTextControl.Proofing.TXSpell.IgnoreWordSettings.Never;
```

1. To check capitalization strictly, set `IgnoreCase` to `TXSpell.IgnoreCaseSettings.Never`.

2. Look for the word in the user dictionaries of the application, and remove it there if it doesn't belong.

[Ignore Settings](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/ignore-settings/llms-full.txt) lists every value, and [User Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-winforms/dictionaries/user/llms-full.txt) describes the words users add.

### 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`, `Always`, `Never`, `WordBegin` and `WordBeginUpper` exclude one another, and in `IgnoreWord`, `Never` can't be combined with any other value.

1. Use at most one of `Always`, `Never`, `WordBegin` and `WordBeginUpper` in `IgnoreCase`.
2. Use `Never` alone in `IgnoreWord`, or leave it out.

[Ignore Settings](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/ignore-settings/llms-full.txt) lists every value and what it can be combined with.

### 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-winforms/reference/txtextcontrol-proofing/spellcheckdialog/llms-full.txt) is open:

| Method | Throws while the dialog is open |
|---|---|
| [TXSpellChecker.Check](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/check-method/llms-full.txt) | Always |
| [DictionaryCollection.Add](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dictionarycollection/add-method/llms-full.txt) and [Remove](https://docs.textcontrol.com/tx-spell-dotnet-winforms/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-winforms/reference/txtextcontrol-proofing/dialogbuttoncollection/add-method/llms-full.txt), [AddRange](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbuttoncollection/addrange-method/llms-full.txt) and [Remove](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-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 form 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-winforms/dictionaries/managing/llms-full.txt) and [Customizing the Spell Check Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/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-winforms/reference/txtextcontrol-proofing/txspellchecker/optionsdialog-method/llms-full.txt) that take `activeTabs` need at least one tab. The indices are zero-based: 0 is the spell checking options, 1 the dictionaries, 2 the hyphenation options and 3 the thesaurus files.

1. Pass an array with at least one index, such as `new int[] { 0 }`.
2. To show all tabs, call `OptionsDialog()` without `activeTabs`.

[Options Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/options-dialog/llms-full.txt) describes the tabs.

### The SpellCheckText Event Isn't Raised

A handler of the [SpellCheckText](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/spellchecktext-event/llms-full.txt) event of the `TextControl` is never called.

`SpellCheckText` is raised only when the [SpellChecker](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/spellchecker-property/llms-full.txt) property of the `TextControl` is `null` and [IsSpellCheckingEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/isspellcheckingenabled-property/llms-full.txt) is `true`. When TX Spell .NET is connected, TX Text Control handles the event internally.

1. To react to the words TX Spell .NET finds, use the events of the spell checker instead; see [Events](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/events/llms-full.txt).
2. To use a spell checker of your own, set `SpellChecker` to `null` and handle `SpellCheckText`.

[TX Text Control .NET for Windows Forms](https://docs.textcontrol.com/tx-spell-dotnet-winforms/integration/tx-text-control/#another-spell-checker) describes the event.

### 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-winforms/reference/txtextcontrol-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-winforms/reference/txtextcontrol-proofing/txspell/llms-full.txt) object, whose [Create](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell/create-method/llms-full.txt) comes first as well.

1. Call `txSpellChecker1.Create()` once, in the constructor of the form after `InitializeComponent`, when no `TextControl` is connected to the spell checker.
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-winforms/getting-started/richtextbox/as-you-type/llms-full.txt) shows the call in a complete form.

### 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, and spell checking is off in the editor by default. [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, so it doesn't tell you whether the package is found.

1. Install `TXTextControl.TXSpell.Core.SDK` in the project that hosts the Document Editor backend, and rebuild it.
2. Switch spell checking on, as [Turn On Spell Checking](https://docs.textcontrol.com/tx-spell-dotnet-winforms/integration/document-editor/#turn-on-spell-checking) shows.

[Check That TX Spell .NET Is Found](https://docs.textcontrol.com/tx-spell-dotnet-winforms/integration/document-editor/#check-that-tx-spell-net-is-found) describes the symptoms of a missing package.

### Related Pages

- [Ignore Settings](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/ignore-settings/llms-full.txt): the words the spell checker skips.
- [Toolbox and Designer](https://docs.textcontrol.com/tx-spell-dotnet-winforms/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-winforms/troubleshooting/dictionaries/llms-full.txt): missing language data and wrong languages.

---

## Nearby

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