ComponentOne SpellChecker for WinForms
C1.Win.C1SpellChecker.4.5.2 Assembly / C1.Win.C1SpellChecker Namespace / C1SpellChecker Class

In This Topic
    C1SpellChecker Class
    In This Topic
    Component that provides spell-checking services to controls and applications.
    Object Model
    C1SpellChecker Class
    Public Class C1SpellChecker 
       Inherits System.ComponentModel.Component
    public class C1SpellChecker : System.ComponentModel.Component 

    The C1SpelChecker component supports three spell-checking modes:

    Batch mode

    Use the CheckText(String), CheckWord, and GetSuggestions(String,Int32) methods to check strings and get lists of errors and spelling suggestions.

    Dialog mode

    Use the CheckControl(ISpellCheckableEditor) method to check the content of any System.Windows.Forms.TextBoxBase-derived controls using a modal dialog. The C1SpellChecker will check the text and display a dialog where the user can choose to correct or ignore each error.

    You can also check editors that do not derive from System.Windows.Forms.TextBoxBase. To do that, you have to create a wrapper class that implements the ISpellCheckableEditor interface.

    As-you-type mode

    Set the extender property SpellCheck on any System.Windows.Forms.TextBoxBase-derived control to true, and the C1SpellChecker will monitor changes to the control. Any spelling mistakes will be indicated on the control by a red, wavy underline; right-clicking the errors will show a context menu with spelling suggestions.

    You can also provide as-you-type spelling support for editors that do not derive from System.Windows.Forms.TextBoxBase. To do that, you have to create a wrapper class that implements the ISpellCheckableRichEditor interface.

    Spell-Checking Options

    In all three modes described above, the spell-checker follows rules that can be customized using the Options property. Options available include types of words to ignore (capitalization, numbers, URLs), whether to display suggestions in a context menu, the number of suggestions to display, and so on.

    Dictionary Deployment

    The C1SpellChecker component uses spelling dictionaries stored in files with a 'dct' extension.

    To select which dictionary to use, use the MainDictionary property and set SpellDictionaryBase.FileName to the name of the file you want to use.

    The easiest way to ensure the dictionary is deployed correctly is to add to your projects a reference to the dictionary file(s) you want to use, then set the Build Action property to None and the Copy to Output Directory property to Copy if newer. This way, the dictionaries will be copied to the output directory along with the application executable and the C1SpellChecker assembly.

    When using this deployment method, make sure the main dictionary's SpellDictionaryBase.FileName value specifies a file name without a path. This way, the component will search for the dictionary in the directory where the C1SpellChecker assembly is located.

    Inheritance Hierarchy


    See Also