Skip to main content

How to: Enable Spelling Check-As-You-Type for the Rich Edit Control

This example describes how to enable check-as-you-type mode in the RichEditSpellChecker and SpellChecker objects.

Enable Check-As-You-Type Mode in RichEditSpellChecker

Use the RichEditSpellChecker.CheckAsYouType property to enable the check-as-you-type mode.

Set the DXRichEditSpellCheckerOptions.AutoDetectDocumentCulture property to true to make the RichEditControl detect the text language automatically.

Note

Consider the following limitations:

  • You cannot change the color (red) or appearance (wavy) of the underline used in the RichEditControl.
  • A custom dictionary specified in XAML does not save words that users add at runtime.
<dxre:RichEditControl x.Name="richEditControl">
    <dxre:RichEditControl.SpellCheckerOptions>
        <dxre:DXRichEditSpellCheckerOptions AutoDetectDocumentCulture="True"/>
</dxre:RichEditControl.SpellCheckerOptions>
    <dxmvvm:Interaction.Behaviors>
        <dxspch:RichEditSpellChecker CheckAsYouType="True"
                                        Culture="en-US"
                                        IgnoreMixedCaseWords="False"
                                        IgnoreUri="False"
                                        SpellingFormType="Word"/>

Enable Check-As-You-Type Mode in a Standalone SpellChecker

The RichEditControl.SpellChecker property allows you to obtain the ISpellChecker instance at runtime. Use the SpellChecker.SpellCheckMode property to enable the mode.

using DevExpress.XtraSpellChecker;
//...
richEdit.SpellChecker.SpellCheckMode = SpellCheckMode.AsYouType;