This topic explains how to implement live spelling in multiple controls of different types.
For example, a form contains several TcxMemo components and one TRichViewEdit. We need to activate live spelling for the focused editor.
For DevExpress's controls (such as TcxMemo), live spelling is activated if RvDxSpellChecker1.CheckAsYouTypeOptions.Active = True.
But this option cannot be used in TRichViewEdit.
Solution: add the code below in OnEnter and OnExit events of TRichViewEdit.
Code: Select all
OnEnter:
RvDxSpellChecker1.CheckAsYouTypeOptions.Active := False;
RvDxSpellChecker1.UpdateRules;
RichViewEdit1.StartLiveSpelling;
OnExit:
RichViewEdit1.ClearLiveSpellingResults;
RvDxSpellChecker1.CheckAsYouTypeOptions.Active := True;
Code: Select all
OnSpellingCheck:
Misspelled := RVdxSpellChecker1.IsMisspelled(AWord);