Heres how i use this dll, obviously you will have to adapt the code to suit your needs, i have an RTB and a button whcih when clicked performs the spellcheck.
Heres how the code is:
vb Code:
Private Sub SpellChecker2_DeletedWord(ByVal sender As Object, ByVal e As NetSpell.SpellChecker.SpellingEventArgs) Handles SpellChecker.DeletedWord 'save existing selecting Dim start As Integer = RichTextBox8.SelectionStart Dim length As Integer = RichTextBox8.SelectionLength 'select word for this event RichTextBox8.Select(e.TextIndex, e.Word.Length) 'delete word RichTextBox8.SelectedText = "" If ((start + length) > RichTextBox8.Text.Length) Then length = 0 End If 'restore selection RichTextBox8.Select(start, length) End Sub ' Handles replacing a word from spell checking Private Sub SpellChecker2_ReplacedWord(ByVal sender As Object, ByVal e As NetSpell.SpellChecker.ReplaceWordEventArgs) Handles SpellChecker.ReplacedWord 'save existing selecting Dim start As Integer = RichTextBox8.SelectionStart Dim length As Integer = RichTextBox8.SelectionLength 'select word for this event RichTextBox8.Select(e.TextIndex, e.Word.Length) 'replace word RichTextBox8.SelectedText = e.ReplacementWord If ((start + length) > RichTextBox8.Text.Length) Then length = 0 End If 'restore selection RichTextBox8.Select(start, length) End Sub
The above 2 just need placing in and the 'richtextbox8' replacing with your rtb.
And then on the button used to trigger the spell check this code:
vb Code:
SpellChecker.Text = RichTextBox8.Text SpellChecker.SpellCheck()




Reply With Quote