Spellchecking in Delphi

TRichView component offers - since Alexandria 11 version - very handy property capable to use Windows built-in spell-checking support without necessity of any special code. The component simply uses local language settings from Windows so that you need not install any external dictionaries, DLLs etc. The name of this property is SpellChecking and it can be invoked at design-time by simple setting it to True or - at runtime - using this line of code:


RichEdit1.SpellChecking:=True;

Consequently, the outcome is crystal-clear: Any typing error occured is underlined with a wavy line. As a matter of fact, Delphi help says that this feature is available only for Windows 8 and later.

Being a developer of database systems, I was curious how will this approach work using DB-aware component of TRichEdit, TDBRichEdit. What was my surprise when I found out that property SpellChecking was not available in TDBRichEdit.

There must be likely omitting by Embarcadero, because SpellChecking property is implemented in TCustomRichEdit class as a public property here and as a published property in TRichEdit class. What is wrong is that SpellChecking as a published property is missing in TDBRichEdit class definiton.

The instant solution is very simple. You cannot actually set SpellChecking property of TDBRichEdit at designtime but you can do it comfortably at runtime:


DBRichEdit1.SpellChecking:=True;

I add that this erroneous behavior has been reported to Embarcadero quality central and hopefully it will be corrected in the future versions of Delphi.

Here we would like to thank to Mr. Tomas Rosinsky for the analysis of this issue and the solution described above.

About the Author

Ing. Karel Janecek, MBA, MSc.
www.torry.net