HasSuggestions
Leave the HasSuggestions property set to the default setting, True. This displays replacement suggestions for the bad word (if any are generated). The Suggestion event is fired each time a new suggestion is added to the Suggestions collection. The BadWord event is fired after the last Suggestion event for a word is fired. When the suggestions are displayed, the user has the following options:
• Ignore the word this time only.
• Ignore the word and any other occurrences of the word.
• Change the word and any other occurrences of the word.
• Add the word to the custom dictionary.
• Cancel the spell-checking process.
The Suggestion and BadWord events are fired whether or not the dialog box is used. However, if you are using the automatic dialog box, there is no need to respond to the events, since the dialog box can handle the user's responses automatically.
That's all there is to it! You can now run your program. Type some words into the textbox and then click on the Check spelling button. If the word is misspelled, the Spelling Check dialog box appears and the BadWord event is fired. If suggestions can be generated for the bad word, the Suggestion event is fired for each suggestion prior to the BadWord event being fired.
After the spell check is complete, the Complete event is fired.
Note: Any code following the setting of the CheckString method will begin executing after the Complete event is fired. For example, if you set the CheckString method from code, any code following the statement that sets the CheckString method will not run until the Complete event is fired.
|