Skip to main content

Spelling Dialog in WPF Spell Checker

  • 2 minutes to read

The Spelling dialog invokes when the SpellChecker component finds a word that is not contained in the dictionaries associated with the current culture.

DXSpellChecker_SpellingDialog

This dialog enables users to do one of the following:

  • Select one of the suggested corrections to replace the misspelled word (once, or every time it occurs);
  • Skip the word;
  • Ignore the word and all its future occurrences in the text;
  • Add the word to a custom dictionary of the Spell Checker. Note that this option is available only if the custom dictionary is available.

The Options… button invokes the Spelling Options dialog. The Undo button allows you to cancel changes, one by one.

Customize Spelling Dialog

The SpellChecker.SpellingFormShowing event allows you to cancel showing the dialog or show a custom dialog.

If the user checks spelling of a selection in a text editor (MemoEdit or RichTextBox), the following message appears after the check is complete:

image

You can hide this message in the SpellCheckerBase.FinishCheckingMainPart event handler. Specify the FinishCheckingMainPartEventArgs.NeedCheckRemainingPart property as shown below:

private void SpellChecker1_FinishCheckingMainPart(object sender, FinishCheckingMainPartEventArgs e)
{
    e.NeedCheckRemainingPart = false;
}

The message below appears when the check is complete or when the user selected not to check the rest of the text:

image

The SpellChecker.CheckCompleteFormShowing event allows you to hide the Spelling Check Is Complete message. Set the Handled parameter to true in the event handler to disable this message.