How to implement

How to implement the Inline Spelling Addon for the Winforms HTML Editor .NET


Please note: The internal spelling capabilities are designed for Windows 8 and 10. They are based on the internal spelling API’s of Win8/10. Windows 7 is not supported.

The inline spelling module can be enabled using the following properties, events, and methods.

Property – DefaultSpellingLanguage as String 

– ID of the language to be used for spelling (en-US, en-GB, fr-FR, fr-CA,  sp-SP etc)

Me.HtmlEditControl1.DefaultSpellingLanguage =  "en-US"

By default the language ID defaults to the users system's default spelling language. Only language packs that have been installed on the system can be used.

Property - EnableInlineSpelling as Boolean

 – enables and disables the internal spelling functionality

Me.HtmlEditControl1.EnableInlineSpelling = True

Method - SpellCheckDocument(ShowDialog as Boolean)

– forces a spelling parse of the HTML with or without a spell checking dialog box

Me.HtmlEditControl1.SpellCheckDocument(False)

Property – SpellingAutoCorrectionList as Hashtable

– A key / value list of autocorrect combinations that are assignable at runtime

For example, adding the following will cause the copyright symbol to be inserted when the user types ‘cw’. The autocorrect value of course can be any html text entity, text based HTML snippet, or plain text;

Me.HtmlEditControl1.SpellingAutoCorrectionList.Add("cw", "©")
Me.HtmlEditControl1.SpellingAutoCorrectionList.Add("td", "trademark")
Me.HtmlEditControl1.SpellingAutoCorrectionList.Add("pp", "<span style="color: red;">pianissimo</span>")

The internal Windows 8/10 custom dictionary is used by the control too. These are system-wide and are generally located at C:\Users\{username}\AppData\Roaming\Microsoft\Spelling\

Event - SpellCheckComplete(sender As Object, e As EventArgs)

- Fires when the spell checking process has completed

AddHandler Me.HtmlEditControl1.SpellCheckComplete, AddressOf HtmlEditControl1_SpellCheckComplete

Private Sub HtmlEditControl1_SpellCheckComplete(sender As Object, e As EventArgs)
        MsgBox("Spell checking completed")
End Sub