# TextControl.SpellChecker Property

> Specifies the spell checking component to be used with a TextControl. The property value must be the key of a resource 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 must be a string. Specifying an empty string, a connected spellchecker can be disconnected. When a spell checking component is connected and the IsSpellCheckingEnabled property has been set to true, misspelled words are automatically underlined with a red zigzag line. The SpellCheckDialog method can be used to correct the misspelled words contained in the document. When a spell checking component is connected and the IsHyphenationEnabled property has been set to true, a document is automatically hyphenated. If the IsLanguageDetectionEnabled property has been set to true, a language is automatically detected for all text parts with a neutral language.

- **Product:** TX Text Control .NET for WPF
- **Section:** Reference
- **Kind:** Property
- **Introduced:** 17.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.SpellChecker Property
- **769 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellchecker-property/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellchecker-property/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellchecker-property/llms-full.txt

---

### Description

Specifies the spell checking component to be used with a TextControl. The property value must be the key of a resource 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 must be a string. Specifying an empty string, a connected spellchecker can be disconnected. When a spell checking component is connected and the [IsSpellCheckingEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/isspellcheckingenabled-property/llms-full.txt) property has been set to true, misspelled words are automatically underlined with a red zigzag line. The [SpellCheckDialog](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/spellcheckdialog-method/llms-full.txt) method can be used to correct the misspelled words contained in the document. When a spell checking component is connected and the [IsHyphenationEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/ishyphenationenabled-property/llms-full.txt) property has been set to true, a document is automatically hyphenated. If the [IsLanguageDetectionEnabled](https://docs.textcontrol.com/tx-text-control-dotnet-wpf/reference/txtextcontrol-wpf/textcontrol/islanguagedetectionenabled-property/llms-full.txt) property has been set to true, a language is automatically detected for all text parts with a neutral language.

### Syntax

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

```vbnet
Public Property SpellChecker As String
```

### Examples

The following XAML example shows how to add a `TXSpellChecker` component 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>
      <txspell:TXSpellChecker x:Key="txspellChecker1"/>
    </tx:TextControl.Resources>
  </tx:TextControl>
</Window>
```

The following example uses `TextControl.SpellChecker` to configure spell checker as part of the text control workflow. The configured value is checked before the workflow continues.

```csharp
textControl.SpellChecker = "Quarterly report";
if (!string.IsNullOrWhiteSpace(textControl.SpellChecker))
{
    Console.WriteLine($"Spell Checker: {textControl.SpellChecker}");
}
```

```vbnet
textControl.SpellChecker = "Quarterly report"
If Not String.IsNullOrWhiteSpace(textControl.SpellChecker) Then
    Console.WriteLine($"Spell Checker: {textControl.SpellChecker}")
End If
```

---

## Nearby

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