Skip to main content
A newer version of this page is available. .

Getting Started

  • 2 minutes to read

This topic describes how to create a simple application that uses the ExpressSpellChecker to check a TcxMemo control’s contents.

To provide a TcxMemo control with the spell-checking capabilities, follow the steps below:

  1. Drop a TcxMemo () control from the Component Palette’s Express Editors page, and the TdxSpellChecker () component from the DevExpress page onto a form.

  2. Select the TdxSpellChecker component. In the Object Inspector, click the ellipsis button next to TdxSpellChecker.DictionaryItems to add dictionaries, which will be used for checking.

The TdxSpellChecker supports the following dictionaries: Hunspell, ISpell, OpenOffice (uses the Hunspell format) and user-defined dictionaries.

  1. For each dictionary, specify the following setting details:
  • Dictionary file. Use the dictionary’s DictionaryPath property to specify the dictionary file’s location. By default, the dictionary file is located in the “Developer Express.VCL\ExpressSpellChecker\Demos\Data” folder.

  • Affix file. This file is required for the ISpell and Hunspell (OpenOffice) dictionaries. These dictionaries use it to build words from an affix-compressed dictionary file (see the DictionaryPath property). Use the dictionary’s GrammarPath property to specify the affix file’s location. By default, the affix file is located in the “Developer Express.VCL\ExpressSpellChecker\Demos\Data” folder.

  • Language encoding. Use the dictionary’s Language property, to specify language specifics. If this property is not specified, the host environment’s settings are used instead.

For the ISpell dictionary, use the dictionary’s CodePage property to specify the corresponding character encoding, to properly load the dictionary, if its code page is different than the host environment’s code page.

Setting the dictionary’s Alphabet property is optional. This property specifies the language alphabet that is used to improve suggestion analysis when building a suggestion list.

  1. Specify spelling options (see the spell checker’s SpellingOptions property), which will be used by the spell checker by default. If necessary, most options can be changed at runtime using the Spelling Options dialog.

  1. Make certain that the spell checker’s AutoLoadDictionaries property is True. If this feature is enabled, dictionaries are loaded automatically when the spell-checking application starts up. To check the TcxMemo‘s contents at runtime, use the TdxSpellChecker.Check method, as shown in the following example:
// ...
<SpellChecker>.Check(<Memo>);
  1. Run the application, enter the text containing misspellings in the TcxMemo, and run the spell-checking process to find errors in the entered text. When the spell checker finds the first wrong entry in the text, it displays the Spelling dialog, prompting you to make the necessary corrections.

Outlook-Style Spelling dialog