ComponentOne SpellChecker for WinForms
C1.Win.C1SpellChecker.4.8 Assembly / C1.Win.C1SpellChecker Namespace / C1SpellChecker Class / ShowSuggestions Event
Example

In This Topic
    ShowSuggestions Event (C1SpellChecker)
    In This Topic
    Occurs when suggestions is about to show in the spell dialog or in the spell context menu.
    Syntax
    'Declaration
     
    Public Event ShowSuggestions As SuggestionsEventHandler
    public event SuggestionsEventHandler ShowSuggestions
    Event Data

    The event handler receives an argument of type SuggestionsEventArgs containing data related to this event. The following SuggestionsEventArgs properties provide information specific to this event.

    PropertyDescription
    Gets the suggestion list.  
    Gets the misspelled word.  
    Remarks

    Use this method to customize the suggestion list. Suggestions can be added, removed or rearranged.

    If the suggestion list contains more items than SpellOptions.MaxSuggestionsInContextMenu, then the additional items won't be shown in the spell context menu.

    This event does not occur when user calls GetSuggestions(String,Int32) method.

    Example
    This example checks the misspelled word and inserts one or more suggestions at the top of the list if need.
    private void c1SpellChecker1_ShowSuggestions(object sender, C1.Win.C1SpellChecker.SuggestionsEventArgs e)
    {
       if (e.Word.StartsWith("o"))
           e.Suggestions.Insert(0, "one new suggestion");
       if (e.Word.Contains("i"))
           e.Suggestions.Insert(0, "is suggestion");
       if (e.Word.StartsWith("tex"))
           e.Suggestions.Insert(0, "text suggestion");
    }
    See Also