Back to Devexpress

Spell Checker Dictionaries

windowsforms-8581-controls-and-libraries-spell-checker-dictionaries.md

latest10.9 KB
Original Source

Spell Checker Dictionaries

  • Feb 19, 2026
  • 4 minutes to read

Supported Dictionaries

The Spell Checker for WinForms supports the following dictionaries:

  • Simple
  • ISpell (https://www.cs.hmc.edu/~geoff/ispell.html)
  • OpenOffice (https://extensions.openoffice.org/)
  • Hunspell (https://hunspell.github.io/)
  • Custom.

If no dictionary is specified and the SpellCheckerBase.Culture property is set to EN-US, the SpellChecker uses the default English dictionary. When other dictionaries are added, the default dictionary is not loaded.

The table below compares supported dictionaries:

SimpleISpellOpenOfficeHunspellCustom
PopularityLowLowHighHighHigh
Word Detection SpeedFastFastFastSlowFast
SizeLargeLargeLargeSmallVarious
Dictionary File Format.dic, .txt.xlg, .dic.dic.dic.dic, .txt
Grammar File (.aff) RequiredNoYesYesYesNo
API ReferenceSpellCheckerDictionarySpellCheckerISpellDictionarySpellCheckerOpenOfficeDictionaryHunspellDictionarySpellCheckerCustomDictionary

Dictionaries can be shared by several SpellChecker components. You can add them to the SharedDictionaryStorage and then set SpellCheckerBase.UseSharedDictionaries to true. Refer to the How to: Use the SharedDictionaryStorage Component topic for a code sample.

Use the SpellCheckerBase.LoadOnDemand property to load the dictionary only when its required.

After each dictionary is successfully loaded, the ISpellCheckerDictionary.DictionaryLoaded event fires. You can subscribe to the SpellCheckerBase.UnhandledException event to catch problematic situations, which may happen while a dictionary is loaded and prepared for use.

For each dictionary, you should specify its Culture and Encoding properties. Complex dictionaries, such as ISpell , OpenOffice or HunSpell , require an affix file , located in the path specified by the GrammarPath property. The need for the alphabet file is due to the method used to generate suggestion lists. For more details, please refer to the SpellCheckerDictionaryBase.AlphabetPath topic.

You can find OpenOffice dictionary at the Dictionaries page of the OpenOffice.org project. Download the required dictionaries extension form the extension repository. Change file extension to zip and unzip it with any archiver. Extract the *.dic and *.aff files to a temporary folder.

Warning

Note that the OpenOffice license cannot be used for commercial projects. Please ensure the relevant license agreement permits use within your application or project.

Custom Dictionary

Add a custom dictionary to store users’ word additions. Users can add an entry from the Spelling Dialog and use the Spelling Options Dialog to edit the dictionary.

The SpellChecker overrides a custom dictionary every time users add new words or edit the word list - this file should not be set to read-only. If the dictionary is not available, ensure another process does not use it.

Add Dictionaries

Add dictionaries to the DevExpress.XtraSpellChecker.DictionaryCollection. Use the SpellCheckerBase.Dictionaries property to access the dictionary collection.

View Example

Simple

csharp
using System.Globalization;
using DevExpress.XtraSpellChecker;
//...

SpellCheckerDictionary simpleDictionary = new SpellCheckerDictionary();
simpleDictionary.AlphabetPath = "EnglishAlphabet.txt";
simpleDictionary.Culture = new CultureInfo("en-US");
simpleDictionary.DictionaryPath = "american.txt";

//Preload the dictionary to speed up the check
simpleDictionary.Load();
spellChecker1.Dictionaries.Add(simpleDictionary);
vb
Imports System.Globalization
Imports DevExpress.XtraSpellChecker
'...

Dim simpleDictionary As New SpellCheckerDictionary()
simpleDictionary.AlphabetPath = "EnglishAlphabet.txt"
simpleDictionary.Culture = New CultureInfo("en-US")
simpleDictionary.DictionaryPath = "american.txt"

'Preload the dictionary to speed up the check
simpleDictionary.Load()
spellChecker1.Dictionaries.Add(simpleDictionary)

ISpell

csharp
using DevExpress.XtraSpellChecker;
using System;
using System.Globalization;

spellChecker1.Dictionaries.Clear();

SpellCheckerISpellDictionary ispellDictionaryEnglish = new SpellCheckerISpellDictionary();
ispellDictionaryEnglish.DictionaryPath = @"Dictionaries\ISpell\en_US\american.xlg";
ispellDictionaryEnglish.GrammarPath = @"Dictionaries\ISpell\en_US\english.aff";
ispellDictionaryEnglish.AlphabetPath = @"Dictionaries\EnglishAlphabet.txt";
ispellDictionaryEnglish.Culture = new CultureInfo("en-US");

//Preload the dictionary to speed up the check
ispellDictionaryEnglish.Load();
spellChecker1.Dictionaries.Add(ispellDictionaryEnglish);
vb
Imports DevExpress.XtraSpellChecker
Imports System
Imports System.Globalization

spellChecker1.Dictionaries.Clear()

Dim ispellDictionaryEnglish As New SpellCheckerISpellDictionary()
ispellDictionaryEnglish.DictionaryPath = "Dictionaries\ISpell\en_US\american.xlg"
ispellDictionaryEnglish.GrammarPath = "Dictionaries\ISpell\en_US\english.aff"
ispellDictionaryEnglish.AlphabetPath = "Dictionaries\EnglishAlphabet.txt"
ispellDictionaryEnglish.Culture = New CultureInfo("en-US")

'Preload the dictionary to speed up the check
ispellDictionaryEnglish.Load()
spellChecker1.Dictionaries.Add(ispellDictionaryEnglish)

Hunspell

csharp
using DevExpress.XtraSpellChecker;
using System;
using System.Globalization;

spellChecker1.Dictionaries.Clear();

HunspellDictionary hunspellDictionaryEnglish = new HunspellDictionary();
hunspellDictionaryEnglish.DictionaryPath = @"Dictionaries\Hunspell\en_US\en_US.dic";
hunspellDictionaryEnglish.GrammarPath = @"Dictionaries\Hunspell\en_US\en_US.aff";
hunspellDictionaryEnglish.Culture = new CultureInfo("en-US");

//Preload the dictionary to speed up the check
hunspellDictionaryEnglish.Load()
spellChecker1.Dictionaries.Add(hunspellDictionaryEnglish);
vb
Imports DevExpress.XtraSpellChecker
Imports System
Imports System.Globalization
spellChecker1.Dictionaries.Clear()

Dim hunspellDictionaryEnglish As New HunspellDictionary()
hunspellDictionaryEnglish.DictionaryPath = "Dictionaries\Hunspell\en_US\en_US.dic"
hunspellDictionaryEnglish.GrammarPath = "Dictionaries\Hunspell\en_US\en_US.aff"
hunspellDictionaryEnglish.Culture = New CultureInfo("en-US")

'Preload the dictionary to speed up the check
hunspellDictionaryEnglish.Load()
spellChecker1.Dictionaries.Add(hunspellDictionaryEnglish)

OpenOffice

csharp
using DevExpress.XtraSpellChecker;
using System;
using System.Globalization;

spellChecker1.Dictionaries.Clear();

SpellCheckerOpenOfficeDictionary openOfficeDictionaryEnglish = new SpellCheckerOpenOfficeDictionary();
openOfficeDictionaryEnglish.DictionaryPath = @"Dictionaries\OpenOffice\en_US\en_US.dic";
openOfficeDictionaryEnglish.GrammarPath = @"Dictionaries\OpenOffice\en_US\en_US.aff";
openOfficeDictionaryEnglish.Culture = new CultureInfo("en-US");

//Preload the dictionary to speed up the check
openOfficeDictionaryEnglish.Load();
spellChecker1.Dictionaries.Add(openOfficeDictionaryEnglish);
vb
Imports DevExpress.XtraSpellChecker
Imports System
Imports System.Globalization

spellChecker1.Dictionaries.Clear()

Dim openOfficeDictionaryEnglish As New SpellCheckerOpenOfficeDictionary()
openOfficeDictionaryEnglish.DictionaryPath = "Dictionaries\OpenOffice\en_US\en_US.dic"
openOfficeDictionaryEnglish.GrammarPath = "Dictionaries\OpenOffice\en_US\en_US.aff"
openOfficeDictionaryEnglish.Culture = New CultureInfo("en-US")

'Preload the dictionary to speed up the check
openOfficeDictionaryEnglish.Load()
spellChecker1.Dictionaries.Add(openOfficeDictionaryEnglish)

Custom

csharp
using DevExpress.XtraSpellChecker;
using System;
using System.Globalization;

SpellCheckerCustomDictionary customDictionary = new SpellCheckerCustomDictionary();
customDictionary.AlphabetPath = @"Dictionaries\EnglishAlphabet.txt";
customDictionary.DictionaryPath = @"Dictionaries\CustomEnglish.dic";
customDictionary.Culture = CultureInfo.InvariantCulture;

//Preload the dictionary to speed up the check
simpleDictionary.Load();
spellChecker1.Dictionaries.Add(customDictionary);
vb
Imports DevExpress.XtraSpellChecker
Imports System
Imports System.Globalization

Dim customDictionary As New SpellCheckerCustomDictionary()
customDictionary.AlphabetPath = "Dictionaries\EnglishAlphabet.txt"
customDictionary.DictionaryPath = "Dictionaries\CustomEnglish.dic"
customDictionary.Culture = CultureInfo.InvariantCulture

'Preload the dictionary to speed up the check
simpleDictionary.Load()
spellChecker1.Dictionaries.Add(customDictionary)

See Also

English Spell Checker Dictionaries

Hunspell

Extensions OpenOffice Page