$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Spell Checker Control for Windows Forms
Perform multilingual spell checking for rich or standard text editors in Windows Forms applications
Home > WinForms UI Controls > User Manual > Dictionaries for SpellChecker in C#

Add Dictionaries to KetticSpellChecker in C#.NET

KetticSpellChecker control for Windows Forms contains a predefined dictionary to perform English spelling check by default setting. When the developers want to set the spell checking to other languages, they can add other language dictionaries into the KetticSpecllChecker control. Additionally, this control is able to perform the mixed languages spelling check and easily change the language and corresponding dictionary used during spell checking. In this C# tutorial, we will go through how to add a custom dictionary to the control

Add a Custom Dictionary into KetticSpellChecker

The following steps demonstrate how to load a French (fr-FR) dictionary to the KetticSpellChecker control and set the dictionary for your Windows application.
  • Load the dictionary file (*.TDF) in the C#.NET Windows Forms project
  • Create a word dictionary descendant and call it FrenchDictionary
  • Override the EnsureDictionaryLoadedOverride method in the descendant C# class
  • Create a MemoryStream according to the TDF file resource
  • Call the Load method of the WordDictionary C# class, and pass the MemoryStream to it as a parameter
The following C# code sample demonstrate how to achieve the steps above

public class FrenchDictionary : WordDictionary
{
protected override void EnsureDictionaryLoadedOverride()
{
using (MemoryStream ms = new MemoryStream(SamplesCS.Properties.Resources.fr_FR))
{
this.Load(ms);
}
}
}
And now, we can add the custom dictionary into the KetticSpellChecker control through the GetControlSpellChecker method. We can use only one KetticSpellChecker instance to add different dictionaries of the same language for spell checking in your application. After we add the custom dictionary to this control, we should define a culture for the control via the CultureInfo property. The C# code below demonstrates how to define the culture.

private static readonly CultureInfo FrenchCulture = CultureInfo.GetCultureInfo("fr-FR");
The following C# code sample shows how to add a dictionary into the KetticSpellChecker WinForms control

IControlSpellChecker textBoxControlSpellChecker = this.ketticSpellChecker1.GetControlSpellChecker(typeof(KetticTextBox));
DocumentSpellChecker documentSpellChecker = textBoxControlSpellChecker.SpellChecker as DocumentSpellChecker;
documentSpellChecker.AddDictionary(new FrenchDictionary(), FrenchCulture);
And then, we can set the SpellCheckingCulture property for the KetticSpellChecker to apply a specific dictionary from the available ones.

documentSpellChecker.SpellCheckingCulture = FrenchCulture;
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls