# Open the Spell Check Dialog

> Open a spelling dialog in Windows Forms from the Proofing ribbon tab, the context menu or a button with TextControl.SpellCheckDialog or SpellCheckDialog.Show.

- **Product:** TX Spell .NET for Windows Forms
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Spell .NET for Windows Forms > Getting Started > TX Text Control > Open the Spell Check Dialog
- **1399 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/tx-text-control/dialog/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/tx-text-control/dialog/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/tx-text-control/dialog/llms-full.txt

---

Underlines point out mistakes one at a time; a spelling dialog goes through all of them in order. With TX Spell .NET connected, the user can open a dialog from the context menu, from the ribbon or from a button of yours, and correct the whole document word by word. You add a **Check Spelling** button to the application of [Create Your First Windows Forms Application](https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/tx-text-control/first-application/llms-full.txt) and try both dialogs that are available.

### Prerequisites

- The application of [Create Your First Windows Forms Application](https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/tx-text-control/first-application/llms-full.txt) or [Create a .NET Framework Application](https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/tx-text-control/dotnet-framework/llms-full.txt): a `TextControl` with a ribbon, connected to a `TXSpellChecker` called *txSpellChecker1*.

### Open the Dialog Without Code

The application already offers the dialog in two places:

- **The context menu.** Right-click an underlined word and click **Spell Check Dialog...**, as [Correct Words from the Context Menu](https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/tx-text-control/context-menu/llms-full.txt) shows.
- **The ribbon.** Open the **Proofing** tab. The group **Spelling & Hyphenation** contains the button **Spelling**, next to **Enable Spell Checking**, which turns the underlines on and off:

    ![The Proofing tab of the ribbon with the groups Spelling & Hyphenation, Settings and Track Changes, the Language button, and the buttons Enable Spell Checking, Enable Hyphenations, Thesaurus and Spelling.](https://docs.textcontrol.com/assets/img/tx-spell-dotnet-winforms/ribbon-proofing-tab.748b5cc8.webp)

The tab is a [RibbonProofingTab](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol-windows-forms-ribbon/ribbonproofingtab/llms-full.txt). Its spelling, hyphenation, thesaurus, dictionary and language detection buttons work only when the `TextControl` has a spell checker connected; the button that sets the language needs none.

### Add a Check Spelling Button

For an application without a ribbon, or for a check before the document is saved, open the dialog in code:

1. Open **Form1** in the designer and draw a `Button` from the **Common Controls** tab of the **Toolbox** onto the form, for example below the editor. Set its **Text** to *Check Spelling* and its **(Name)** to *buttonSpelling*.
2. Double-click the button. Visual Studio creates its `Click` handler in *Form1.cs*.
3. Call the [SpellCheckDialog](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/spellcheckdialog-method/llms-full.txt) method of the `TextControl` in the handler:

```csharp
private void buttonSpelling_Click(object sender, EventArgs e)
{
    // Open the spelling dialog of TX Text Control
    textControl1.SpellCheckDialog();
}
```

1. Press **F5**, type a few misspelled words and click **Check Spelling**.

The dialog steps through all misspelled words of the document: the main text first, then the headers, footers and text frames. When the last word is handled, a message tells the user that the spell checking is complete. `SpellCheckDialog` works only when a spell checker is connected through the `SpellChecker` property.

### Use the Customizable Dialog of TX Spell .NET

The dialog that `SpellCheckDialog` opens belongs to TX Text Control and can't be changed. TX Spell .NET has a dialog of its own, which works the same way but can be customized: buttons can be added, removed or relabeled, and your code is notified of every change. Open it with the [SpellCheckDialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/txspellchecker/spellcheckdialog-property/llms-full.txt) property of the spell checker. Replace the body of the `buttonSpelling_Click` handler from the previous section:

```csharp
private void buttonSpelling_Click(object sender, EventArgs e)
{
    // Open the customizable dialog of TX Spell .NET for this TextControl
    txSpellChecker1.SpellCheckDialog.Show(textControl1);
}
```

[Show](https://docs.textcontrol.com/tx-spell-dotnet-winforms/reference/txtextcontrol-proofing/spellcheckdialog/show-method/llms-full.txt) takes the `TextControl` to check. The dialog applies the corrections to the document itself, so no further code is needed:

![The Spelling dialog of TX Spell .NET over a TextControl, with the misspelled word "sampke" in its sentence, the suggestions, the Suggestions Dictionary en_US.dic and the buttons Ignore Once, Ignore All, Add To Dictionary, Change, Change All, Options and Cancel.](https://docs.textcontrol.com/assets/img/tx-spell-dotnet-winforms/textcontrol-spelling-dialog.1c62f1f3.webp)

It shows the language of the word above the sentence and, below the suggestions, a **Suggestions Dictionary** list, which chooses the dictionary the suggestions come from when several are loaded. **Options...** opens the options dialog.

### Correct the Words in the Dialog

The dialog of TX Spell .NET shows the misspelled word in its sentence and the suggestions below. For each word, the user chooses what to do:

1. Select a suggestion and click **Change** to replace this occurrence, or **Change All** to replace every occurrence of the word.
2. Click **Ignore Once** to skip this occurrence, or **Ignore All** to skip every occurrence.
3. Click **Add To Dictionary** to accept the word for good. This needs an editable user dictionary; see [User Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-winforms/dictionaries/user/llms-full.txt).
4. Click **Cancel** to stop before the end.

The dialog then moves on to the next misspelled word.

The *TextControl\\SpellCheckDialog* sample of the setup is built this way; [Spell Checking Examples](https://docs.textcontrol.com/tx-spell-dotnet-winforms/examples/spell-checking/llms-full.txt) lists where it is installed.

### Next Steps

- [Checking on Demand](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/on-demand/llms-full.txt): compare the two dialogs and control how a check ends.
- [Spell Check Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/spell-check-dialog/llms-full.txt): every part of the dialog of TX Spell .NET.
- [Customizing the Spell Check Dialog](https://docs.textcontrol.com/tx-spell-dotnet-winforms/user-interface/customizing-dialog/llms-full.txt): add, remove and relabel its buttons.
- [Checking Multiple Controls](https://docs.textcontrol.com/tx-spell-dotnet-winforms/spell-checking/multiple-controls/llms-full.txt): check several editors in one dialog.

---

## Nearby

- **Previous:** [Correct Words From the Context Menu](https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/tx-text-control/context-menu/llms-full.txt)
- **Next:** [RichTextBox and TextBox](https://docs.textcontrol.com/tx-spell-dotnet-winforms/getting-started/richtextbox/llms-full.txt)
