I am trying to follow this thread
http://www.vbforums.com/showthread.p...ght=spellcheck
and I have it pretty close but have one error.
That error is on both of these, in blueHandles clause requires a WithEvents variable defined in the containing type or one of its base types.
I have added the reference, I have also added them to the toolbox. My dictionary is all set. What did I miss?Code:Private Sub SpellChecker1_DeletedWord(ByVal sender As Object, ByVal e As NetSpell.SpellChecker.SpellingEventArgs) Handles SpellChecker1.DeletedWord 'save existing selecting Dim activeRichTextBox = TryCast(Me.ActiveControl, RichTextBox) Dim start As Integer = activeRichTextBox.SelectionStart Dim length As Integer = activeRichTextBox.SelectionLength 'select word for this event activeRichTextBox.Select(e.TextIndex, e.Word.Length) 'delete word activeRichTextBox.SelectedText = "" If ((start + length) > activeRichTextBox.Text.Length) Then length = 0 End If 'restore selection activeRichTextBox.Select(start, length) End Sub ' Handles replacing a word from spell checking Private Sub SpellChecker1_ReplacedWord(ByVal sender As Object, ByVal e As NetSpell.SpellChecker.ReplaceWordEventArgs) Handles SpellChecker1.ReplacedWord 'save existing selecting Dim activeRichTextBox = TryCast(Me.ActiveControl, RichTextBox) Dim start As Integer = activeRichTextBox.SelectionStart Dim length As Integer = activeRichTextBox.SelectionLength 'select word for this event activeRichTextBox.Select(e.TextIndex, e.Word.Length) 'replace word activeRichTextBox.SelectedText = e.ReplacementWord If ((start + length) > activeRichTextBox.Text.Length) Then length = 0 End If 'restore selection activeRichTextBox.Select(start, length) End Sub




Reply With Quote