# TextControl.SpellCheckContextMenu Property

> Specifies the context menu which is used when the end-user right-clicks a misspelled word. A context menu is only available when a spell checking component has been connected with the SpellChecker property.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 18.0
- **Namespace:** `TXTextControl.WPF`
- **Package:** `TXTextControl.TextControl.WPF.SDK` (assembly `TXTextControl.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.WPF.dll` from the setup
- **Path:** TX Text Control .NET for WPF > Reference > TXTextControl.WPF > TextControl.SpellCheckContextMenu Property
- **801 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellcheckcontextmenu-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellcheckcontextmenu-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellcheckcontextmenu-property/llms-full.txt

---

### Description

Specifies the context menu which is used when the end-user right-clicks a misspelled word. A context menu is only available when a spell checking component has been connected with the [SpellChecker](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellchecker-property/llms-full.txt) property.

### Syntax

```csharp
public string SpellCheckContextMenu { get; set; }
```

```vbnet
Public Property SpellCheckContextMenu As String
```

### Members

| Value | Description |
|---|---|
| (none) | No context menu is displayed when the end-user right-clicks a misspelled word. |
| (Default) | The TXTextControl built-in context menu is displayed when the end-user right-clicks a misspelled word. |
| other | The property value must be the key of a user-defined context menu. Such a context menu must be added to the `Resources` dictionary of a TextControl or a parent of a TextControl in the logical element tree of the application. The resource key of the resource must be specified as property value of this property. The example below shows how to add a user-defined spell check context menu in XAML. |

### Examples

The following XAML example shows how to add a user-defined `ContextMenu` to the `Resources` dictionary of a TextControl:

```plaintext
<Window xmlns:tx="clr-namespace:TXTextControl.WPF;assembly=TXTextControl.WPF"
    xmlns:txspell="clr-namespace:TXTextControl.WPF.Proofing;assembly=TXSpell.WPF">
  <tx:TextControl Name="textControl1">
    <tx:TextControl.Resources>
      <ContextMenu x:Key="UserSpellCheckMenu">
        <MenuItem Click="MenuItem1_Clicked" Header="MenuItem1"/>
        <MenuItem Click="MenuItem2_Clicked" Header="MenuItem2"/>
        <MenuItem Click="MenuItem3_Clicked" Header="MenuItem3"/>
      </ContextMenu>
    </tx:TextControl.Resources>
  </tx:TextControl>
</Window>
```

The following example uses `TextControl.SpellCheckContextMenu` to configure spell check context menu as part of the text control workflow. The configured value is checked before the workflow continues.

```csharp
textControl.SpellCheckContextMenu = "Quarterly results";
if (!string.IsNullOrWhiteSpace(textControl.SpellCheckContextMenu))
{
    Console.WriteLine($"Spell Check Context Menu: {textControl.SpellCheckContextMenu}");
}
```

```vbnet
textControl.SpellCheckContextMenu = "Quarterly results"
If Not String.IsNullOrWhiteSpace(textControl.SpellCheckContextMenu) Then
    Console.WriteLine($"Spell Check Context Menu: {textControl.SpellCheckContextMenu}")
End If
```

---

## Nearby

- **Previous:** [TextControl.SignatureFieldSelected Event](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/signaturefieldselected-event/llms-full.txt)
- **Next:** [TextControl.SpellCheckDialog Method](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellcheckdialog-method/llms-full.txt)
