[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Collapse]Spell Checker
   [Expand]Product Information
   [Collapse]Getting Started
     Lesson 1 - Add Spell Checking to Your Application
     Lesson 2 - Create Simple Application to Check Spelling in MemoEdit
   [Expand]Fundamentals
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Lesson 1 - Add Spell Checking to Your Application

This topic will show how to add spell-check functionality to your application, using the SpellChecker component. Dictionaries for US English are built-in and will be used by default.

Note

If no dictionary is specified, SpellChecker uses default English dictionary. When any other dictionary is added, even a custom dictionary, default dictionary is not loaded. Note that the default English dictionary is used when the machine's current culture is EN-US.

The SpellChecker component can check the spelling of a wide range of text editors.

Please follow the steps below. We assume that your application's form has several different text editors from the list of supported controls.

Expanded Step 1. Add a SpellChecker Component

Add the SpellChecker component to your project. To do this, simply drag the corresponding item from the DX.18.1: Components toolbox tab, and drop it onto the form that contains text controls.

Expanded Step 2. Add Code for Check Spelling On Demand

To start checking the spelling in all supported controls on the form when clicking the button:

  • Add the SimpleButton control (located on the DX.18.1: Common Controls toolbox tab) to the form;
  • Subscribe to the button's Click event.
  • To start spell checking and invoke the spelling dialog to make corrections when you click the button, call the SpellChecker.CheckContainer method.

    Show Me

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T588203.

Expanded Step 3. Add Code for Check Spelling As You Type

To enable SpellChecker to check the spelling of all supported controls on the form as you type:

  • Subscribe to the form's Load event;
  • Add the following code to the Load event handler:

    Show Me

    A complete sample project is available in the DevExpress Code Examples database at http://www.devexpress.com/example=T588203.

    This code instructs the SpellChecker to underline the misspelled word when the end-user finishes typing the word or moves the cursor after changing it, and allows selecting a suggestion from the context menu, invoked by right-clicking the word.

Expanded Step 4. Run the project.

The misspelled words are underlines in the text control which has the focus. The RichEditControl always display underlines whether it has focus or not, as illustrated in the following picture:

Click the Check Spelling button to start spelling check for all controls on the form and invoke the Spelling Dialog.

Is this topic helpful?​​​​​​​