# Spell Check Dialog

> The Spelling dialog of TX Spell .NET in Windows Forms part by part: every button type, SpellCheckDialog.Show, ShowDialogSettings and how a check ends.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Spell .NET for Windows Forms > User Interface > Spell Check Dialog
- **2465 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/spell-check-dialog/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/spell-check-dialog/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/spell-check-dialog/llms-full.txt

---

The **Spelling** dialog of TX Spell .NET walks the user through the misspelled words of a document, one word at a time: it shows the word in its sentence, lists suggestions and offers to change, ignore or learn the word. Each part of the dialog is described below, together with what each button does and how to decide where the dialog opens and how a check ends.

### Which Dialog This Is

A `TextControl` with a connected spell checker offers two spelling dialogs. TX Text Control opens its own preconfigured dialog from the **Spell Check Dialog...** item of its context menu. The dialog described here is the one of TX Spell .NET, a [SpellCheckDialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/llms-full.txt) that you get from the [SpellCheckDialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/spellcheckdialog-property/llms-full.txt) property of the [TXSpellChecker](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/llms-full.txt). It checks a `TextControl` as well as a `RichTextBox`, a `TextBox` or any other control, and you can change its buttons, texts and behavior.

Both dialogs look alike to the user. [Checking on Demand](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/on-demand/llms-full.txt) compares them and shows when to choose which.

### The Parts of the Dialog

The dialog has the title **Spelling**. Its parts are numbered in the picture below and described in the table after it:

![The Spelling dialog with numbered parts: 1 the line "Misspelled word - Language: English (United States)", 2 the sentence with the misspelled word "sampke" in red, 3 the buttons Ignore Once, Ignore All and Add To Dictionary, 4 the list of suggestions, 5 the buttons Change and Change All, 6 the Suggestions Dictionary list with en_US.dic, 7 the Options button and 8 the Cancel button.](https://docs.textcontrol.com/assets/img/tx-spell-dotnet-winforms/spell-check-dialog-parts.8c939609.webp)

|  | Part | What it shows or does |
|---|---|---|
| 1 | **Misspelled word - Language** | The language of the word. For text without language information, such as the text of a `RichTextBox`, it reads "No language set" |
| 2 | Preview | The sentence that contains the misspelled word, with the word in red. The user can edit the sentence here |
| 3 | **Ignore Once**, **Ignore All**, **Add To Dictionary** | Skip the word, skip it everywhere, or add it to a user dictionary |
| 4 | **Suggestions** | The words that could be meant, at most 10 by default |
| 5 | **Change**, **Change All** | Replace the word with the selected suggestion, here or everywhere |
| 6 | **Suggestions Dictionary** | The dictionary the suggestions come from |
| 7 | **Options...** | Opens the [Options Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/options-dialog/llms-full.txt) |
| 8 | **Cancel** | Closes the dialog before the check is complete |

The three groups of buttons at 3, 5 and 7 are collections of the `SpellCheckDialog`: [IgnoreButtons](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/ignorebuttons-property/llms-full.txt), [ChangeButtons](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/changebuttons-property/llms-full.txt) and [OptionButtons](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/optionbuttons-property/llms-full.txt). The preview at 2 is described by [Preview](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/preview-property/llms-full.txt), the list at 4 by [SuggestionList](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/suggestionlist-property/llms-full.txt) and the list at 6 by [SuggestionDictionaryComboBox](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/suggestiondictionarycombobox-property/llms-full.txt). [Customizing the Spell Check Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/customizing-dialog/llms-full.txt) changes the buttons and the preview, and [Suggestion Controls](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/suggestions/llms-full.txt) the two lists.

### What Each Button Does

Each button of the dialog has a type, a value of [TXSpell.ButtonType](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell-buttontype/enumeration/llms-full.txt), that decides what a click does:

| Button | Type | What happens |
|---|---|---|
| **Ignore Once** | `Ignore` | The word is skipped at this place only |
| **Ignore All** | `IgnoreAll` | Every occurrence of the word is skipped |
| **Add To Dictionary** | `AddToDictionary` | The word is added to the user dictionaries and is no longer marked |
| **Change** | `Change` | The word is replaced with the selected suggestion |
| **Change All** | `ChangeAll` | Every occurrence of the word is replaced with the selected suggestion |
| **Options...** | `Options` | The options dialog opens |

**Add To Dictionary** is enabled only when a user dictionary has been added to the dictionaries of the spell checker; in the picture, none has. [User Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-winforms/dictionaries/user/llms-full.txt) shows how to add one.

Two more types change a button while the dialog is open:

- **Delete** replaces a button when the current word repeats the word before it, as in "the the". It removes the repeated word. A button becomes a **Delete** button when its [IsDeleteButton](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbutton/isdeletebutton-property/llms-full.txt) property is `true`.
- **Undo Edit** replaces a button as soon as the user edits the sentence in the preview. It discards the edit. A button becomes an **Undo Edit** button when its [IsUndoEditButton](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/dialogbutton/isundoeditbutton-property/llms-full.txt) property is `true`; when no button has it set, the preview can't be edited.

When the user presses Enter, the dialog clicks its [AcceptButton](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/acceptbutton-property/llms-full.txt), which is **Ignore Once** by default.

### Open the Dialog

[Show](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/show-method/llms-full.txt) opens the dialog: with a `TextControl`, which the dialog corrects itself, or without arguments for the words a call of [Check](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/check-method/llms-full.txt) found in any other text. [Checking on Demand](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/on-demand/#open-the-dialog-of-tx-spell-net) shows both ways and the overloads of `Show`.

### What the Dialog Checks

For a `TextControl`, the dialog checks the main text and then the headers, footers and text frames, and [ChangeInAllTextParts](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/changeinalltextparts-property/llms-full.txt) and [IgnoreInAllTextParts](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/ignoreinalltextparts-property/llms-full.txt) decide whether **Change All** and **Ignore All** reach into the other parts; [Checking Text Parts](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/text-parts/llms-full.txt) describes both. The dialog can also continue from one control to the next, so that the user checks a whole form in one pass, as [Checking Multiple Controls](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/multiple-controls/llms-full.txt) shows.

### Choose Where the Dialog Opens

By default, the dialog opens in the center of the screen. [ShowDialogSettings](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/showdialogsettings-property/llms-full.txt) sets its owner and its start position. Set them once, for example in the constructor of the form, after `InitializeComponent`:

```csharp
using TXTextControl.Proofing;

// Center the dialog on this form instead of the screen
txSpellChecker1.SpellCheckDialog.ShowDialogSettings.Owner = this;
txSpellChecker1.SpellCheckDialog.ShowDialogSettings.StartPosition = TXSpell.DialogStartPosition.CenterOwner;
```

The code works as follows:

- [Owner](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/showdialogsettings/owner-property/llms-full.txt) is the window that owns the dialog. A `Form` can be passed directly.
- [StartPosition](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/showdialogsettings/startposition-property/llms-full.txt) takes a value of [TXSpell.DialogStartPosition](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspell-dialogstartposition/enumeration/llms-full.txt): `CenterScreen`, the default, `CenterOwner`, or `Manual`, which opens the dialog at the screen coordinates in [Location](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/showdialogsettings/location-property/llms-full.txt).

To open the dialog where the user left it, read the [Location](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/location-property/llms-full.txt) of the `SpellCheckDialog` after it closes. It holds the last position of the dialog's upper-left corner, and `Point.Empty` before the dialog was shown for the first time.

### Decide How a Check Ends

Two properties of the `SpellCheckDialog` decide what the user sees when the last word is handled:

| Property | Default | Effect |
|---|---|---|
| [CloseOnFinished](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/closeonfinished-property/llms-full.txt) | `true` | The dialog closes when the check is complete |
| [ShowMessageBoxes](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/showmessageboxes-property/llms-full.txt) | `true` | Message boxes tell the user that the check is complete, or that a word the user typed is not in the suggestion dictionary |

Set `ShowMessageBoxes` to `false` to report the result in your own way, for example in a status bar.

The [SpellCheckDialogOpening](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/spellcheckdialogopening-event/llms-full.txt) and [SpellCheckDialogClosing](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/spellcheckdialogclosing-event/llms-full.txt) events of the `TXSpellChecker` fire when the dialog opens and closes. [Events](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/events/llms-full.txt) shows what their arguments carry.

### The Dialog on High-Resolution Screens

Since version 8.0, the spell check dialog and the options dialog scale with the display, also on setups with several monitors of different scale factors; [High DPI and Display Scaling](https://docs.textcontrol.com/tx-spell-dotnet-winforms/integration/dpi-scaling/llms-full.txt) describes the setting.

### Next Steps

- [Customizing the Spell Check Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/customizing-dialog/llms-full.txt): add, remove and rename buttons, and change the font and the preview.
- [Options Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/options-dialog/llms-full.txt): the settings the **Options...** button opens.
- [Suggestion Controls](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/suggestions/llms-full.txt): the suggestion list and the dictionary list of the dialog.
- [Localization and Resource Kit](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/localization/llms-full.txt): show the dialog in the language of the user.
- [Checking on Demand](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/on-demand/llms-full.txt): open the dialog from a button, for TX Text Control and a `RichTextBox`.

---

## Nearby

- **Previous:** [User Interface](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/llms-full.txt)
- **Next:** [Customizing the Spell Check Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/customizing-dialog/llms-full.txt)
