# ThesaurusDialog Class

> The ThesaurusDialog class implements a Windows Forms dialog box that shows synonyms for selected text or a word at the current input position which will be selected on opening the dialog. If no text is selected or no word is located at the current input position, the dialog is opened without any created synonyms. For all these cases the dialog provides a text box to enter and edit that text which is used to find synonyms. Furthermore a combobox to select a specific language (a language item represents all enabled thesaurus files with the same culture) or thesaurus file (no language was defined for this file) is placed to the right of the text box. Both typing text into the text box and changing the selected language leads to an update of the displayed synonyms. Additionally new synonyms are created for the current selected synonym when the space key is pressed or the item is double clicked. In this case the back button is enabled to step back to the last synonym search request. To insert a selected synonym into the TextControl or to replace selected text with it, the user can press the Replace button or the Enter key.

- **Product:** TX Text Control .NET for Windows Forms
- **Section:** Reference
- **Kind:** Class
- **Introduced:** 25.0
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.WinForms.SDK` (assembly `TXTextControl.Windows.Forms.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.Windows.Forms.dll` from the setup
- **Inherits:** `System.Windows.Forms.Form`
- **Path:** TX Text Control .NET for Windows Forms > Reference > TXTextControl > ThesaurusDialog Class
- **1345 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/llms-full.txt

---

### Description

The ThesaurusDialog class implements a Windows Forms dialog box that shows synonyms for selected text or a word at the current input position which will be selected on opening the dialog. If no text is selected or no word is located at the current input position, the dialog is opened without any created synonyms. For all these cases the dialog provides a text box to enter and edit that text which is used to find synonyms. Furthermore a combobox to select a specific language (a language item represents all enabled thesaurus files with the same culture) or thesaurus file (no language was defined for this file) is placed to the right of the text box. Both typing text into the text box and changing the selected language leads to an update of the displayed synonyms. Additionally new synonyms are created for the current selected synonym when the space key is pressed or the item is double clicked. In this case the back button is enabled to step back to the last synonym search request. To insert a selected synonym into the TextControl or to replace selected text with it, the user can press the Replace button or the Enter key.

Each item of the dialog box has a name, available through its Name property, which corresponds with a member of the [ThesaurusDialog.DialogItem](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/dialogitem-enumeration/llms-full.txt) enumeration. The [ThesaurusDialog.FindItem](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/finditem-method/llms-full.txt) method can be used to get a certain item and manipulate, move or delete it.

To use this dialog the TextControl must be [connected](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/spellchecker-property/llms-full.txt) with an object of type `TXSpellChecker` (version 7.0 or higher). Otherwise an exception is thrown.

### Syntax

```csharp
public class ThesaurusDialog : Form
```

```vbnet
Public Class ThesaurusDialog
    Inherits Form
```

### Examples

The following example creates a ThesaurusDialog object and shows the dialog box:

```csharp
ThesaurusDialog dlg = new ThesaurusDialog(textControl1);
dlg.ShowDialog();
```

```vbnet
Dim dlg As New ThesaurusDialog(textControl1)
dlg.ShowDialog()
```

The following example creates a Thesaurus Dialog instance and configures its allow transparency setting for a document workflow.

```csharp
using ThesaurusDialog thesaurusDialog = new(new TextControl());
thesaurusDialog.AllowTransparency = true;
```

```vbnet
Dim thesaurusDialog As New ThesaurusDialog(New TextControl())
thesaurusDialog.AllowTransparency = True
```

---

## In This Section

- [ThesaurusDialog Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/constructor/llms-full.txt): Creates a ThesaurusDialog object for the specified Windows Forms TextControl.
- [ThesaurusDialog.DialogItem Enumeration](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/dialogitem-enumeration/llms-full.txt): Each DialogItem represents an item in a ThesaurusDialog dialog box. The corresponding string of a DialogItem is the same as the item's Name property. The DialogItem enumeration can be used with the ThesaurusDialog.FindItem method to get the item and manipulate it.
- [ThesaurusDialog.FindItem Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/finditem-method/llms-full.txt): Finds a control that has the provided identifier name.

---

## Nearby

- **Previous:** [TextPartCollection.GetMainText Method](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textpartcollection/getmaintext-method/llms-full.txt)
- **Next:** [ThesaurusDialog Constructor](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/thesaurusdialog/constructor/llms-full.txt)
