In addition to the standard MainDictionary and UserDictionary dictionaries, C1SpellChecker also supports custom dictionaries. You can specify the custom dictionary with the CustomDictionary property.
For example, you can create a custom dictionary that accepts as correct any words that start with 'z'; therefore, any word that starts with 'z' will be correct.
To write code in Visual Basic
Visual Basic |
Copy Code
|
---|---|
Private _customDict As New MySpellDictionary() Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load C1SpellChecker1.CustomDictionary = _customDict End Sub Public Class MySpellDictionary Implements C1.Win.C1SpellChecker.ISpellDictionary Public Function Contains(ByVal word As String) As Boolean Implements C1.Win.C1SpellChecker.ISpellDictionary.Contains Return word.StartsWith("z", StringComparison.InvariantCultureIgnoreCase) End Function End Class |
To write code in C#
C# |
Copy Code
|
---|---|
MySpellDictionary _customDict = new MySpellDictionary(); private void Form1_Load(object sender, EventArgs e) { c1SpellChecker1.CustomDictionary = _customDict; } public class MySpellDictionary : C1.Win.C1SpellChecker.ISpellDictionary { public bool Contains(string word) { return word.StartsWith("z", StringComparison.InvariantCultureIgnoreCase); } } |