Back to Devexpress

How to: Register Custom Control to Enable Spell Checking

wpf-120354-controls-and-libraries-spell-checker-examples-how-to-register-custom-control-to-enable-spell-checking.md

latest1.2 KB
Original Source

How to: Register Custom Control to Enable Spell Checking

  • Apr 01, 2021

The following example describes how to implement the spell checker in custom or standard text controls (TextBox or RichTextBox).

Register Standard Text Control

  1. In XAML, configure the text control’s DXSpellChecker behavior.

  2. In code-behind, register the control by calling the SpellingSettings.RegisterTextControl method.

Register the RichEditControl descendant

  1. In XAML, configure the custom control’s RichEditSpellChecker behavior.

  2. To enable the Spelling dialog for the custom control, call the SpellCheckTextControllersManager.Default.RegisterClass method. This method requires the DevExpress.XtraSpellChecker.Native namespace reference. Call the SpellCheckTextBoxBaseFinderManager.Default.UnregisterClass method to disable spelling check.