i00 VB.NET Spell Check - No 3rd Party Components Required!
Introduction
I wanted a spell check that I could use in .NET, so like most people would have done, I Googled. After many hours of fruitless searching, I decided to make my own; sure there are plenty of spell checkers out there, but I didn't want one that relied on 3rd party components such as Word or require Internet connectivity to work. Introducing i00 .NET Spell Check, the first and only VB.NET Spell Check written completely in VB! Not only that, it is also open source, and easy to use.
Screen Shots
Spell check with definitions
In-menu word definitions and Change to...
Adding words to dictionary
Custom content menus
Crossword generator
Options
Owner draw and RTB support
Using the Code
To implement i00 .NET Spell Check into your project, first either:
- Reference the i00SpellCheck.exe file that is output from this project
- Add the
i00SpellCheck
project to your solution and reference it - or you can bring all of *.vb files in the "SpellCheck\Spell Check" folder (from the zip) directly into your own project
Next, simply place this at the very top of your form:
* the code below may change if you used option 3 to "Imports YourProject.i00SpellCheck
"):
Imports SpellCheck.i00SpellCheck
Now you will be able to enable spell check. The above line will enable spell checking on all multiline textboxes on your form, and all owned forms that are opened.
Some other examples are below:
''enable the spell check
''this will enable the spell check on ALL TEXT FIELDS ON THIS form
''AND ALL TEXT FIELDS ON ALL OWNED FORMS AS THEY OPEN automatically :)
''... but only for multi line Rich/Text Boxes
Me.EnableSpellCheck()
''To enable spell check on single line textboxes you will need to call:
''TextBox.SpellCheck()
''if you wanted to pass in options you can do so by going:
Dim SpellCheckSettings As New i00SpellCheck.SpellCheckSettings
SpellCheckSettings.DoSubforms = true 'Specifies if owned forms
'should be automatically spell checked
SpellCheckSettings.AllowAdd = true 'Specifies if you want to
'allow the user to add words to the dictionary
SpellCheckSettings.AllowIgnore = true 'Specifies if you want
'to allow the user ignore words
SpellCheckSettings.AllowRemove = true 'Specifies if you want
'to allow users to delete words from the dictionary
SpellCheckSettings.AllowInMenuDefs = true 'Specifies if the
'in menu definitions should be shown for correctly spelled words
SpellCheckSettings.AllowChangeTo = true 'Specifies if "Change to..."
'(to change to a synonym) should be shown in the menu for correctly spelled words
Me.EnableSpellCheck(SpellCheckSettings)
''You can also enable spell checking on one text field:
TextBox1.SpellCheck()
''Note that the above is NOT threaded - so if you fire it from the
''interface it can "freeze" for a second if the dictionary is not yet loaded
''(unless you load the dictionary in a separate thread).
''To change options on an individual text box:
TextBox1.SpellCheck.AllowAdditions = True
TextBox1.SpellCheck.AllowIgnore = True
TextBox1.SpellCheck.AllowRemovals = True
TextBox1.SpellCheck.ShowMistakes = True
''To load a custom dictionary from a saved file:
Dim Dictionary = New i00SpellCheck.SpellCheckTextBox.Dictionary("c:\Custom.dic")
''To create a new blank dictionary and save it as a file
Dim Dictionary = New i00SpellCheck.SpellCheckTextBox.Dictionary("c:\Custom.dic", True)
Dictionary.Add("CustomWord1")
Dictionary.Add("CustomWord2")
Dictionary.Add("CustomWord3")
Dictionary.Save()
''To Load a custom dictionary for an individual text box:
TextBox1.SpellCheck.CurrentDictionary = Dictionary
Even more examples are included in the Test project in the download.
Points of Interest
The words that get checked are added to a dictionary cache to speed up checking - the smaller cache is checked first. If the word is not found in the cache, then it checks the main dictionary.
I use fields (public
variables) instead of properties for some basic classes, as they are about 2x faster than properties.
Thanks
Thanks for downloading.
Suggestions on possible improvements are much appreciated.
发表评论
qpujGD in this regard that cannot. Also visit my blog post; Garden Furniture Oil
zndAkn There is clearly a bundle to know about this. I assume you made certain nice points in features also.
VtRDqS This page truly has all the information and facts I wanted concerning this subject and didn at know who to ask.
acnDIv Really appreciate you sharing this article post.Really thank you! Awesome.
D9rpsG
79gQhz My brother recommended I may like this website. He was totally right.
kKYAMp You made some first rate points there. I looked on the internet for the problem and found most individuals will associate with along with your website.
34YQFn Really informative article.Really looking forward to read more. Great.
QPeQ6b I truly appreciate this article.Really thank you! Fantastic.
56pnHS You made some nice points there. I looked on the internet for the topic and found most persons will approve with your site.
dHr1Gy Magnificent site. A lot of useful info here. I'm sending it to some friends ans also sharing in delicious. And naturally, thanks for your sweat!
UEVpiO Nice blog here! Also your site loads up fast! What host are you using? Can I get your affiliate link to your host? I wish my website loaded up as fast as yours lol
DF4h0F I appreciate you sharing this blog article.Really looking forward to read more. Great.
rdGj8Y Thank you for your blog article. Really Great.
3m9jUy Really enjoyed this post.Really thank you! Will read on...
x1QdfA I cannot thank you enough for the blog article.Thanks Again. Much obliged.