Back to Devexpress

How to: Obtain a List of Commands for the Misspelled Word

windowsforms-5135-controls-and-libraries-spell-checker-examples-how-to-obtain-a-list-of-commands-for-the-misspelled-word.md

latest1.1 KB
Original Source

How to: Obtain a List of Commands for the Misspelled Word

  • Jan 13, 2020

The code below shows how to obtain the list of spellCheck commands for the clicked misspelled word.

Use the SpellCheckerCommand.DoCommand method to execute this command.

csharp
using DevExpress.XtraSpellChecker;
using DevExpress.XtraSpellChecker.Rules;
// ...
Point position = e.Control.PointToClient(e.Position);
SpellCheckErrorBase error = spellChecker1.CalcError(position);
List<SpellCheckerCommand> commands = spellChecker1.GetCommandsByError(error);
vb
Imports DevExpress.XtraSpellChecker
Imports DevExpress.XtraSpellChecker.Rules
' ...
Private position As Point = e.Control.PointToClient(e.Position)
Private [error] As SpellCheckErrorBase = spellChecker1.CalcError(position)
Private commands As List(Of SpellCheckerCommand) = spellChecker1.GetCommandsByError([error])

See Also

SpellCheckerCommand