# TXSpellChecker.Check Method

> Checks text for spelling errors and fills the IncorrectWordCollection at TXSpellChecker.IncorrectWords with all incorrect words. The first implementation uses selected dictionaries of the DictionaryCollection at TXSpellChecker.Dictionaries. The second implementation uses selected dictionaries of the TXSpellChecker.Dictionaries DictionaryCollection and the default dictionary folder where the dictionary's language equals to the defined language parameter. Only those dictionaries are used whose Dictionary.IsSpellCheckingEnabled properties are set to true.

- **Product:** TX Spell .NET for WPF
- **Section:** Reference
- **Kind:** Method
- **Namespace:** `TXTextControl.WPF.Proofing`
- **Package:** `TXTextControl.TXSpell.WPF.SDK` (assembly `TXSpell.WPF.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXSpell.WPF.dll` from the setup
- **Path:** TX Spell .NET for WPF > Reference > TXTextControl.WPF.Proofing > TXSpellChecker.Check Method
- **1114 words**
- **Web URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/check-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/check-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/check-method/llms-full.txt

---

### Description

Checks text for spelling errors and fills the [IncorrectWordCollection](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/incorrectwordcollection/llms-full.txt) at [TXSpellChecker.IncorrectWords](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/incorrectwords-property/llms-full.txt) with all [incorrect words](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/incorrectword/llms-full.txt). The first implementation uses selected [dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionary/llms-full.txt) of the [DictionaryCollection](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionarycollection/llms-full.txt) at [TXSpellChecker.Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/dictionaries-property/llms-full.txt). The second implementation uses selected [dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionary/llms-full.txt) of the [TXSpellChecker.Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/dictionaries-property/llms-full.txt) [DictionaryCollection](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionarycollection/llms-full.txt) and the default dictionary folder where the [dictionary's language](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionary/language-property/llms-full.txt) equals to the defined language parameter. Only those [dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/dictionaries-property/llms-full.txt) are used whose [Dictionary.IsSpellCheckingEnabled](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionary/isspellcheckingenabled-property/llms-full.txt) properties are set to true.

### Syntax

#### Check(string)

Checks text for spelling errors using selected [dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionary/llms-full.txt) of the [DictionaryCollection](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionarycollection/llms-full.txt) at [TXSpellChecker.Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/dictionaries-property/llms-full.txt).

```csharp
public void Check(string text);
```

```vbnet
Public Sub Check(text As String)
```

| Parameter | Description |
|---|---|
| text | Specifies the text to spell check. |

#### Check(string, CultureInfo)

Checks text for spelling errors using selected [dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionary/llms-full.txt) of the [TXSpellChecker.Dictionaries](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/dictionaries-property/llms-full.txt) [DictionaryCollection](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionarycollection/llms-full.txt) and the default dictionary folder where the [dictionary's language](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-proofing/dictionary/language-property/llms-full.txt) equals to the defined language parameter.

```csharp
public void Check(string text, CultureInfo language);
```

```vbnet
Public Sub Check(text As String, language As CultureInfo)
```

| Parameter | Description |
|---|---|
| text | Specifies the text to spell check. |
| language | The language that is used to spell check the specified text. |

### Examples

The following example uses Check in a focused TXSpell Checker workflow. The created object is then available to the surrounding document workflow.

```csharp
tXSpellChecker.Check("Quarterly results", System.Globalization.CultureInfo.GetCultureInfo("en-US"));
Console.WriteLine("TXSpell Checker is ready for use.");
```

```vbnet
tXSpellChecker.Check("Quarterly results", System.Globalization.CultureInfo.GetCultureInfo("en-US"))
Console.WriteLine("TXSpell Checker is ready for use.")
```

### Remarks

This method throws an exception, if called while the SpellCheckDialog is open.

---

## Nearby

- **Previous:** [TXSpellChecker.AvailableSynonymLists Property](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/availablesynonymlists-property/llms-full.txt)
- **Next:** [TXSpellChecker Constructor](https://docs.textcontrol.com/tx-spell-dotnet-wpf/reference/txtextcontrol-wpf-proofing/txspellchecker/constructor/llms-full.txt)
