catch spelling errors, VB.Net express 2008 (1 Viewer)

Dick7Access

Dick S
Local time
Today, 01:16
Joined
Jun 9, 2009
Messages
4,201
I am very new at VB. I have a small program that I have made just to practice coding. I want to catch spelling errors in the text box, and bring up a msgbox that says misspelling. but I have no idea where to start. Help anyone will be appreciated. Thanks in advance, Dick S.

Public Class Form1
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If txtboxBooks.Text = "" Then MsgBox("You did not type anything")


If txtboxBooks.Text = "Matthew" Then MsgBox("First book of the NT")
If txtboxBooks.Text = "matthew" Then MsgBox("You forgot to use a Capital M")
If txtboxBooks.Text = "Mark" Then MsgBox("Second book of the NT")
If txtboxBooks.Text = "mark" Then MsgBox("You forgot to use a Capital M")
If txtboxBooks.Text = "Luke" Then MsgBox("Third book of the NT")
If txtboxBooks.Text = "luke" Then MsgBox("You forgot to use a Capital L")
If txtboxBooks.Text = "John" Then MsgBox("Fourth book of the NT")
If txtboxBooks.Text = "john" Then MsgBox("You forgot to use a Capital J")
If txtboxBooks.Text = "Acts" Then MsgBox("Fifth book of the NT")
If txtboxBooks.Text = "acts" Then MsgBox("You forgot to use a Capital A")
If txtboxBooks.Text = "Romans" Then MsgBox("Sixth book of the NT")
If txtboxBooks.Text = "romans" Then MsgBox("You forgot to use a Capital R")









End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
txtboxBooks.Text =
""
End Sub
End
Class
 

tehNellie

Registered User.
Local time
Today, 06:16
Joined
Apr 3, 2007
Messages
751
Unless you specifically want to warn the user rather than just validate/correct the information provided automatically you could just use something like ToTitleCase

or Regular expressions could also be used to check the format (rather than the spelling) of the supplied string and prompt the user if necessary.

You could always call the MS Word Spellchecker from within your application to check the spelling/grammar of the supplied string:

http://www.codeproject.com/KB/vb/WordSpellCheckNoReference.aspx
 

Dick7Access

Dick S
Local time
Today, 01:16
Joined
Jun 9, 2009
Messages
4,201
Hi,
Yes, that is what I finally figured out. I am calling up the build in MS spell checker.
 

Users who are viewing this thread

Top Bottom