Spell Checker!
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
6 posts
Page 1 of 1
ATTN:Credits go to http://www.a1vbcode.com/app-3641.asp but I only used the code and edited it bit
What You Need
1 Label (Label1)
1 Button(Button1)
1 TextBox(TextBox1)
_________________________________________________
Form1 Properties:
Size: 472, 68
Text: Spell Checker (DUH)
MinimizeBox = False
MaximizeBox = False
FormBorderStyle = Fixed Single
_________________________________________________
TextBox1 Properties:
Size: 237, 20
Text:
Location 12, 8
_________________________________________________
Label1 Properties:
Size: 85, 13
Location: 336, 11
Text: The Spelling is...
_________________________________________________
Button1 Properties:
Size: 75, 23
Location: 255, 6
Text: Check
_________________________________________________
Coding Time!
Code:
_________________________________________________________________________
Screenshots: Of course!
A word that is spelled correct:
A word that is spelling incorrect,I just made it up obviously:
Please +Rep me if you liked it and think it is useful

_______________________________________________________________
NOTE:YOU NEED MIRCOSOFT OFFICE FOR IT TO WORK!!
What You Need
1 Label (Label1)
1 Button(Button1)
1 TextBox(TextBox1)
_________________________________________________
Form1 Properties:
Size: 472, 68
Text: Spell Checker (DUH)
MinimizeBox = False
MaximizeBox = False
FormBorderStyle = Fixed Single
_________________________________________________
TextBox1 Properties:
Size: 237, 20
Text:
Location 12, 8
_________________________________________________
Label1 Properties:
Size: 85, 13
Location: 336, 11
Text: The Spelling is...
_________________________________________________
Button1 Properties:
Size: 75, 23
Location: 255, 6
Text: Check
_________________________________________________
Coding Time!
Code:
Code: Select all
Public Class Form1
Public Function OnlyCharacter(ByVal key As String) As Boolean
If (key >= 65 And key <= 90) Or (key >= 97 And key <= 122) Or key = 8 Then
OnlyCharacter = False
Else
OnlyCharacter = True
End If
End Function
Private Function chkSplng(ByVal sTxt As String) As Boolean
Dim spellCheker As New Object()
spellCheker = CreateObject("Word.Application")
chkSplng = spellCheker.CheckSpelling(sTxt)
End Function
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
e.Handled = OnlyCharacter(Asc(e.KeyChar))
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Text As String
On Error Resume Next
Text = TextBox1.Text
If Text = "" Then
MsgBox("Type a text to check if the spelling is correct!", vbExclamation)
Exit Sub
End If
If chkSplng(Text) = True Then
Label1.ForeColor = Color.Green
Label1.Text = "The Spelling is Correct!"
Else
Label1.ForeColor = Color.Red
Label1.Text = "The Spelling is Incorrect!"
End If
Text = ""
End Sub
End Class
_________________________________________________________________________
Screenshots: Of course!
A word that is spelled correct:
A word that is spelling incorrect,I just made it up obviously:
Please +Rep me if you liked it and think it is useful


_______________________________________________________________
NOTE:YOU NEED MIRCOSOFT OFFICE FOR IT TO WORK!!
You do not have the required permissions to view the files attached to this post.
Last edited by code it on Sun Jan 09, 2011 1:28 am, edited 3 times in total.
This will only work if you have Microsoft Office installed or it will fail at CreateObject("Word.Application").
nice, too bad we need word lol
Nailing my feet to the floor is easier than using my own muscles to balance, but you don't see me doing that 

6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023