# Ignore Settings

> Choose which words TXSpellChecker skips in Windows Forms: IgnoreCase and IgnoreWord flags, Ignore and Ignore All, duplicates and a locked ignore list.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Spell .NET for Windows Forms > Spell Checking > Ignore Settings
- **2570 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/ignore-settings/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/ignore-settings/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/ignore-settings/llms-full.txt

---

Should "NASA" be flagged because the dictionary only knows "nasa"? Should "www.textcontrol.com" or "R2D2" be checked at all? Two properties of the spell checker answer such questions for every check it makes, whether TX Text Control underlines words as the user types or your code calls `Check`. Beside these rules, the user can ignore single words from the context menu and the spell check dialog, and an ignore list keeps names and product terms out of the check for good.

### What the Spell Checker Skips by Default

A [TXSpellChecker](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/llms-full.txt) has two ignore settings. Both are flags: you combine several values with `|`.

- **[IgnoreCase](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/ignorecase-property/llms-full.txt)**, of type [IgnoreCaseSettings](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell-ignorecasesettings/enumeration/llms-full.txt), decides when the capitalization of a word does not count. The default is `AllUpper | WordBeginUpper`.
- **[IgnoreWord](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/ignoreword-property/llms-full.txt)**, of type [IgnoreWordSettings](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell-ignorewordsettings/enumeration/llms-full.txt), decides which words are not checked at all. The default is `InUpperCase | IsEmail | IsURL | WithNumbers`.

With the defaults, a word in capitals such as "NASA", a word with digits such as "R2D2", an e-mail address and a URL are not checked. A word that starts with a capital letter, such as "House" at the beginning of a sentence, is found in the dictionary under "house". A word that repeats the word in front of it, as in "the the", is reported, because `Duplicated` is not part of the default.

### Choose How Case Is Handled

`IgnoreCase` takes these values of `TXSpell.IgnoreCaseSettings`:

| Value | The case of a word is ignored |
|---|---|
| `Always` | Always |
| `Never` | Never: "house", "House" and "HOUSE" must each match the dictionary |
| `WordBegin` | For the first character |
| `WordBeginUpper` | For the first character, if it is uppercase |
| `AllUpper` | If all characters are uppercase |
| `AllLower` | If all characters are lowercase |

`Always`, `Never`, `WordBegin` and `WordBeginUpper` exclude one another: use at most one of them. Each of the four can be combined with `AllUpper`, `AllLower` or both. Any other combination throws an exception.

This line makes the spell checker check capitalization strictly, so that a proper noun written in lowercase is reported:

```csharp
txSpellChecker1.IgnoreCase = TXTextControl.Proofing.TXSpell.IgnoreCaseSettings.Never;
```

### Choose Which Words Are Not Checked

`IgnoreWord` takes these values of `TXSpell.IgnoreWordSettings`:

| Value | Words that are not checked |
|---|---|
| `InUpperCase` | Words in which all characters are uppercase |
| `WithNumbers` | Words that contain numbers |
| `IsEmail` | E-mail addresses |
| `IsURL` | URLs |
| `Duplicated` | Duplicated words: a word that repeats the one in front of it is not reported |
| `Never` | None: every word is checked |

All values except `Never` can be combined; combining `Never` with another value throws an exception. This code keeps the defaults and adds `Duplicated`, so that repeated words are no longer reported:

```csharp
using TXTextControl.Proofing;

txSpellChecker1.IgnoreWord =
    TXSpell.IgnoreWordSettings.InUpperCase |
    TXSpell.IgnoreWordSettings.WithNumbers |
    TXSpell.IgnoreWordSettings.IsEmail |
    TXSpell.IgnoreWordSettings.IsURL |
    TXSpell.IgnoreWordSettings.Duplicated;
```

The code works as follows:

- The enumerations are nested in the [TXSpell](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell/llms-full.txt) class, so their full names start with `TXSpell.`.
- The new value replaces the old one. To add a flag to the current settings, write `txSpellChecker1.IgnoreWord |= TXSpell.IgnoreWordSettings.Duplicated;`.

A reported duplicate is an [IncorrectWord](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/incorrectword/llms-full.txt) whose [IsDuplicate](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/incorrectword/isduplicate-property/llms-full.txt) property is `true`; in TX Text Control, a [MisspelledWord](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/misspelledword/llms-full.txt) with [IsDuplicate](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/misspelledword/isduplicate-property/llms-full.txt) set. A duplicate has nothing to be replaced with, so a correction interface offers to delete it instead.

The [TXSpell](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell/llms-full.txt) class, which checks text in code without a user interface, has the same [IgnoreCase](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell/ignorecase-property/llms-full.txt) and [IgnoreWord](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell/ignoreword-property/llms-full.txt) properties with the same defaults.

### Let the User Change the Settings

The first tab of the options dialog of TX Spell .NET, **Spell Checking Options**, shows the ignore settings to the user: each check box and list stands for a value of `IgnoreWord` or `IgnoreCase`. [The Spell Checking Options Tab](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/options-dialog/#the-spell-checking-options-tab) lists them, and [Options Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/options-dialog/llms-full.txt) shows how to open the dialog with this tab only or replace it with a dialog of your own.

### Ignore Single Words

Ignoring a word from the user interface does not change the settings above. It applies to the word the user chose:

- **Ignore** in the context menu, and **Ignore Once** in the spell check dialog, ignore this occurrence of the word.
- **Ignore All** ignores every occurrence of the word.

In TX Text Control, an ignored word stays in the collection of misspelled words with [IsIgnored](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/misspelledword/isignored-property/llms-full.txt) set to `true`, and loses its red underline. With any other control, the word is removed from [IncorrectWords](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/incorrectwords-property/llms-full.txt).

![The context menu of a misspelled word in a RichTextBox, with Ignore, Ignore All and Add To Dictionary below the suggestions.](https://docs.textcontrol.com/assets/img/tx-spell-dotnet-winforms/richtextbox-context-menu.f03e53b3.webp)

In the spell check dialog, **Ignore Once** is the accept button by default ([AcceptButton](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/acceptbutton-property/llms-full.txt)), so pressing Enter ignores the current word and moves to the next:

![The Spelling dialog with the buttons Ignore Once, Ignore All and Add To Dictionary next to the sentence that contains the misspelled word.](https://docs.textcontrol.com/assets/img/tx-spell-dotnet-winforms/textcontrol-spelling-dialog.1c62f1f3.webp)

When a `TextControl` is checked with the [SpellCheckDialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/llms-full.txt) of TX Spell .NET, an ignore operation applies in all text parts of the document -- the main text, headers, footers and text frames -- because [IgnoreInAllTextParts](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/ignoreinalltextparts-property/llms-full.txt) is `true` by default.

### Keep an Ignore List

Product names, abbreviations and customer names are correct but in no dictionary. To have them accepted in every document, put them in a [UserDictionary](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/llms-full.txt) that the user cannot change. Such a dictionary is checked like any other, so its words are never reported, but the **Add To Dictionary** commands do not write to it:

```csharp
using System.Globalization;
using TXTextControl.Proofing;

// The user dictionary that Add To Dictionary writes to
UserDictionary userDictionary = new UserDictionary();
txSpellChecker1.Dictionaries.Add(userDictionary);
userDictionary.Language = new CultureInfo("en-US");

// The ignore list, filled in code
UserDictionary ignoreList = new UserDictionary();
txSpellChecker1.Dictionaries.Add(ignoreList);
ignoreList.Language = new CultureInfo("en-US");
ignoreList.AddWord("TXTextControl");
ignoreList.AddWord("TXSpell");

// Lock the list after it is filled
ignoreList.IsEditable = false;
```

The code works as follows:

- [Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/dictionaries-property/llms-full.txt) takes any number of dictionaries, so the ignore list is checked beside the language dictionary and the editable user dictionary.
- [AddWord](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/addword-method/llms-full.txt) has no effect before the dictionary is added to `Dictionaries`, or once [IsEditable](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/userdictionary/iseditable-property/llms-full.txt) is `false`. That is why the list is added first, filled next and locked last.
- `IsEditable` is `true` by default. Set to `false`, it keeps the context menu and the dialog from adding words to this dictionary.

The approach comes from the blog article [TX Spell .NET: Ignore Word List Using User Dictionaries](https://www.textcontrol.com/blog/2014/01/10/tx-spell-net-ignore-word-list-using-user-dictionaries/). [User Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-winforms/dictionaries/user/llms-full.txt) covers loading user dictionaries from files and saving them.

### Next Steps

- [User Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-winforms/dictionaries/user/llms-full.txt): store the words users add, and load them in the next session.
- [Options Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/options-dialog/llms-full.txt): the dialog in which users change these settings.
- [Incorrect Words and Suggestions](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/suggestions/llms-full.txt): read what the check found, duplicates included.
- [Events](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/events/llms-full.txt): react when the user ignores or replaces a word.

---

## Nearby

- **Previous:** [Incorrect Words and Suggestions](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/suggestions/llms-full.txt)
- **Next:** [Checking Multiple Controls](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/multiple-controls/llms-full.txt)
