Using a Custom Spell-Check Engine

    The built-in spell checker covers everyday US English, but plenty of applications work in a vocabulary it was never meant to know: legal case citations, pharmaceutical compound names, internal part numbers, or an industry's own shorthand. Flagging every one of those terms as a typo trains users to ignore the red squiggle altogether, defeating the point of having a spell checker at all. For that situation, the WinForms HTML Editor lets you swap in your own spell-check engine instead of the built-in one - your dictionary, your rules, your suggestions. Implement the five-method ISpellCheckerEngine interface and assign your implementation to the control; the built-in checker is bypassed entirely, and every Spell, Suggest, and Add call, for both inline squiggles and dialog mode, is routed through your code instead.

    Architecture diagram showing the SpiceLogic WinForms HTML Editor delegating Spell and Suggest calls through a custom ISpellCheckerEngine implementation to an external terminology service.
    Architecture diagram showing the SpiceLogic WinForms HTML Editor delegating Spell and Suggest calls through a custom ISpellCheckerEngine implementation to an external terminology service.

    The Interface

    Implement ISpellCheckerEngine to plug in a custom spell-check engine. The editor calls only these five methods.

    namespace SpiceLogic.HtmlEditor.Abstractions.Entities.SpellCheck; public interface ISpellCheckerEngine {     void Initialize(string dictionaryPath, string affixPath, string userDictionaryPath);     bool Spell(string word);     IEnumerable<string> Suggest(string word, int? max = null);     void AddToUserDictionary(string word);     void Dispose(); }
    Namespace SpiceLogic.HtmlEditor.Abstractions.Entities.SpellCheck     Public Interface ISpellCheckerEngine         Sub Initialize(dictionaryPath As String, affixPath As String, userDictionaryPath As String)         Function Spell(word As String) As Boolean         Function Suggest(word As String, Optional max As Integer? = Nothing) As IEnumerable(Of String)         Sub AddToUserDictionary(word As String)         Sub Dispose()     End Interface End Namespace 

    Registering the Engine

    At startup, set CustomSpellCheckerEngine to your engine instance and SpellChecker to SpellCheckerEngineTypes.Custom. This routes inline squiggles and the spell-check dialog through your engine:

    public partial class TrialReportForm : Form {     public TrialReportForm(TerminologyServiceClient service)     {         InitializeComponent();         editor.SpellCheckOptions.CustomSpellCheckerEngine = new ClinicalTermsEngine(service);         editor.SpellChecker = SpellCheckerEngineTypes.Custom;         editor.SpellCheckOptions.FireInlineSpellCheckingOnKeyStroke = true;     } }
    End Sub  Public Partial Class TrialReportForm     Inherits Form     Public Sub New(service As TerminologyServiceClient)         InitializeComponent()         editor.SpellCheckOptions.CustomSpellCheckerEngine = New ClinicalTermsEngine(service)         editor.SpellChecker = SpellCheckerEngineTypes.Custom         editor.SpellCheckOptions.FireInlineSpellCheckingOnKeyStroke = True

    Once registered, every word is checked against your engine: recognized words are not flagged, unrecognized ones are marked misspelled.

    Trial report editor in the SpiceLogic WinForms HTML Editor accepting industry-specific compound names as valid while flagging an unknown variant via the custom ISpellCheckerEngine.
    Trial report editor in the SpiceLogic WinForms HTML Editor accepting industry-specific compound names as valid while flagging an unknown variant via the custom ISpellCheckerEngine.

    When the simple engine isn't enough

    Two production refinements: fail open by wrapping Spell to return true when the backend is unreachable, so a blip does not flag every word until reconnection; and cache suggestions for the most recent few hundred mis-hits per session, avoiding one HTTP call per unknown word on large documents, while honoring the max hint - inline suggestions request three, the dialog ten.

    Patterns this same plug-in serves

    The interface also supports a company terminology server, a domain-specific dictionary (e.g., legal contracts and citations), or a backend engine that also checks grammar, style, and tone - no Hunspell binary needed, and the inline squiggle UI still works once SpellChecker = SpellCheckerEngineTypes.Custom is set.

    Sample to start from

    See the Custom Spell Checker sample in the installation's Samples folder: it implements ISpellCheckerEngine against a small in-memory vocabulary, wired into a WinFormHtmlEditor as shown above.

    Last updated on May 15, 2026

    Put this into practice.

    .NET WinForms HTML Editor Control ships with free C# and VB.NET sample projects and a 14-day evaluation.

    Prefer a guided look? Book a free live demo with our engineers - live on Zoom or Teams, never a chatbot.