Spell Checker Context Menu
- 2 minutes to read
If the SpellChecker component is in your application, it can automatically embed its custom items to the context menu of DevExpress TextEdit and MemoEdit controls or its descendants. These items allow end-users to check spelling within these controls.
To enable this functionality at design time within Visual Studio, set the ShowSpellCheckMenu on spellChecker property to True for the TextEdit or MemoEdit control. Note, that at runtime you can modify this property’s value via the SpellChecker.SetShowSpellCheckMenu method.
This adds the Check Spelling item to the context menu of the control to be checked by the SpellChecker component. The Check Spelling item starts spell checking and invokes the Spelling Dialog.
Although the ShowSpellCheckMenu on spellChecker extender property is available for standard TextBox and RichTextBox controls in the Properties window, it always returns False for them, because XtraSpellChecker doesn’t provide the capability to automatically expand context menus for these standard controls. So, if there is a context menu for these controls, you should manually add the Check Spelling item to it.
If the SpellChecker checks spelling of the control as you type, the extended context menu of the control is invoked when an end-user right-clicks the incorrect word. This context menu contains additional items allowing end-users to automatically correct or skip a misspelled word:
- the list of spelling suggestions to replace incorrect word;
- the Ignore All item to skip all word occurrences in the text;
- the Add to Dictionary item to add the word to a custom dictionary of the SpellChecker.
You can set the number of suggested words for display on the context menu by using the CheckAsYouTypeOptions.SuggestionCount property.
Also, you can use the CheckAsYouTypeOptions.ShowSpellCheckForm property to set whether the Spelling dialog can be invoked when SpellChecker is in the As You Type mode and the end-user selects the Check Spelling item from the context menu. It can be useful if you want to allow end-users to replace words only via the context menu.