Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

20130521 - i00 Spell Check and Control Extensions -No Third Party Components Required

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
i00 Spell Check and Control Extensions - No Third Party Components Required

Code Project Prize winner in Competition "Best VB.NET article of October 2011"

Download
Anyone wishing to use this code in their projects may do so, however are required to leave a post on this thread stating that they are using this.
A simple "I am using i00 Spell check in my project" will suffice.


DO NOT MIRROR
DO NOT LINK DIRECTLY TO THIS FILE - LINK TO THIS POST INSTEAD
DO NOT RE-DISTRIBUTE THIS SOURCE CODE PARTLY OR IN ITS ENTIRETY

Latest Version now hosted on Code Project:

Go here to download!

Total Downloads:


Downloads per day:


About

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.

Eventually, this project progressed even further into a generic control extension plugin that provides plugins for text box printing, translation, speech recognition and dictation plus more; while also providing a simple method for users to write their own extensions.

Donations
rykk - $30
Member 2262881 (POSabilities Inc.) - $100

Donate Here - and be sure to put "i00 Spell Check", your user name (or other alias), and if you want the amount disclosed in the description field :)

Users
Users have been moved to their own post since the post size had been reached

Click here for users

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


Spell check dialog


Support for DataGridViews!


Plugin support ... with label plugin


Plugin support ... with FastColoredTextBox plugin


Implementation
To implement i00 .Net Spell Check into your project first either:
  • add the i00SpellCheck project to your solution and reference it (recommended)
  • reference the i00SpellCheck.exe file that is output from this project*
  • or you can bring all of *.vb files in the "SpellCheck\Spell Check" folder (from the zip) directly into your own project*
NOTE: For the methods with the * you will need to also copy the dictionary files to the applications path

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")
[highlight=vb]Imports i00SpellCheck[/highlight]

Now you will be able to enable spell checking by placing the following in your form load event:
[highlight=vb]Me.EnableControlExtensions()[/highlight]
The above line will enable control extensions on all controls that are supported on the form, and all owned forms that are opened.

Other examples are below:
[highlight=vb]'To load a single control extension on a control call:
ControlExtensions.LoadSingleControlExtension(TextBox1, New TextBoxPrinter.TextBoxPrinter)

'To enable spell check on single line textboxes you will need to call:
TextBox1.EnableSpellCheck()

'If you wanted to pass in options you can do so by handling the ControlExtensionAdding event PRIOR to calling EnableControlExtensions:
AddHandler ControlExtensions.ControlExtensionAdding, AddressOf ControlExtensionAdding
'Also refer to the commented ControlExtensionAdding Sub in this form for more info

'You can also enable spell checking on an individual Control (if supported):
TextBox1.EnableSpellCheck()

'To disable the spell check on a Control:
TextBox1.DisableSpellCheck()

'To see if the spell check is enabled on a Control:
Dim SpellCheckEnabled = TextBox1.IsSpellCheckEnabled()
'To see if another control extension is loaded (in this case call see if the TextBoxPrinter Extension is loaded on TextBox1):
Dim PrinterExtLoaded = TextBox1.ExtensionCast(Of TextBoxPrinter.TextBoxPrinter)() IsNot Nothing

'To change spelling options on an individual Control:
TextBox1.SpellCheck.Settings.AllowAdditions = True
TextBox1.SpellCheck.Settings.AllowIgnore = True
TextBox1.SpellCheck.Settings.AllowRemovals = True
TextBox1.SpellCheck.Settings.ShowMistakes = True
'etc

'To set control extension options / call methods from control extensions (in this case call Print() from TextBox1):
Dim PrinterExt = TextBox1.ExtensionCast(Of TextBoxPrinter.TextBoxPrinter)()
PrinterExt.Print()

'To show a spellcheck dialog for an individual Control:
Dim iSpellCheckDialog = TryCast(TextBox1.SpellCheck, i00SpellCheck.SpellCheckControlBase.iSpellCheckDialog)
If iSpellCheckDialog IsNot Nothing Then
iSpellCheckDialog.ShowDialog()
End If

'To load a custom dictionary from a saved file:
Dim Dictionary = New i00SpellCheck.FlatFileDictionary("c:\Custom.dic")

'To create a new blank dictionary and save it as a file
Dim Dictionary = New i00SpellCheck.FlatFileDictionary("c:\Custom.dic", True)
Dictionary.Add("CustomWord1")
Dictionary.Add("CustomWord2")
Dictionary.Add("CustomWord3")
Dictionary.Save()

'To Load a custom dictionary for an individual Control:
TextBox1.SpellCheck.CurrentDictionary = Dictionary

'To Open the dictionary editor for a dictionary associated with a Control:
'NOTE: this should only be done after the dictionary has loaded (Control.SpellCheck.CurrentDictionary.Loading = False)
TextBox1.SpellCheck.CurrentDictionary.ShowUIEditor()

'Repaint all of the controls that use the same dictionary...
TextBox1.SpellCheck.InvalidateAllControlsWithSameDict()




''This is used to setup spell check settings when the spell check extension is loaded:
Private Sub ControlExtensionAdding(ByVal sender As Object, ByVal e As ControlExtensionAddingEventArgs)
Dim SpellCheckControlBase = TryCast(e.Extension, SpellCheckControlBase)
If SpellCheckControlBase IsNot Nothing Then
Static SpellCheckSettings As i00SpellCheck.SpellCheckSettings 'Static for settings to be shared amongst all controls, use dim for control specific settings...
If SpellCheckSettings Is Nothing Then
SpellCheckSettings = New i00SpellCheck.SpellCheckSettings
SpellCheckSettings.AllowAdditions = 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.AllowRemovals = 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
End If
SpellCheckControlBase.Settings = SpellCheckSettings
End If
End Sub[/highlight]

Even more examples are included in the Test projects included in the download :).

Plugins
Since version 20120618 i00SpellCheck has plugin support.

Plugins in i00SpellCheck allow components to be spell checked by making a dll or exe file that contains a public class that inherits i00SpellCheck.SpellCheckControlBase.

They automatically get picked up and allow the spellchecking of extra controls, with no reference to the file itself required. However you will need to place them in the applications path.

The use of plugins allow users to enable spellchecking of their controls, without having to change the i00SpellCheck project.

Another use for them could be to allow the programmer to quickly see if they have spelling errors on forms etc. For example placing the LabelPlugin.exe file in an application path (that already uses i00SpellCheck) will cause all labels in the existing project to be spell checked ... with NO code changes! When the developer wants to deploy their application they simply need to remove the LabelPlugin.exe file, and labels will no longer be corrected.

The basic procedures for creating a plugin are as follows:

  • Start by creating a new project (class library or exe)
  • Reference i00SpellCheck
  • Make a class that inherits i00SpellCheck.SpellCheckControlBase
  • Override the ControlType Property to return the type of control that you want your plugin to spell check
  • Add your code

For examples on inheriting i00SpellCheck.SpellCheckControlBase check out the examples in the Plugins path in the download.

Version Changes
Version changes have been moved to their own post since the post size had been reached

Click here for version changes

Possible Issues
SpellCheckTextBox
Since the Textbox has no way to really draw on it "nicely" I used to capture the WM_PAINT of the control and then draw on the textbox graphics that was set by going Graphics.FromHwnd... this seemed to work well but produced a slight flicker that I thought was undesirable...

As of version 20120102 the render method now uses layered windows (by default), this basically means that all of the underlines that appear to be drawn on the control are actually drawn on another window over the top of the control ...

So how does this affect the user? Well in most cases it doesn't, the form is click-through and only the drawings are visible not the form itself. In fact if you press start + tab in Windows Vista/7 it even appears on the same window!

As I said above "in most cases"...
MIDI forms I haven't tested, but am quite sure that they won't work using the new render method.
Overlapping controls appear as follows:

And if the textbox is off the form the corrections appear to "Float" outside the form.

So in cases such as the above, you will have to go back to the older "compatible" rending, this can be done in these cases by going:
DirectCast(TextBox.SpellCheck, SpellCheckTextBox).RenderCompatibility = True

Thanks
A special thanks to Pavel Torgashov for his excellent FastColoredTextBox control. This control is used in the solution to test i00SpellCheck's plugin architecture with 3rd party controls. i00 has not modified this control in any way and is only responsible for integrating the spell checking ability to it via an i00SpellCheck plugin. In no way is this control required for spell checking functions in other projects within the solution.

Thanks for downloading... Also please provide feedback, rate this thread and say thanks if this helped you

Suggestions on possible improvements are much appreciated

Also I extend a special thanks to the users who thanked / rated this post.

Thanks again
Kris
 
Last edited:

moti barski

Banned
Joined
Mar 25, 2009
Messages
764
Re: i00 .Net Spell Check - No 3rd party components required!

something is missing from the walkthrough :
this line : Imports SpellCheck.i00SpellCheck
it means some files are needed to be added to the solution explorer or some dll reference ?
could you please complete the walkthrough
 

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

NOTE: I have put this in it's own post as i have run out of room in the main one (has a char limit)

Version Changes

Next Version
Nothing yet... check back later...

Hopefully ...
  • Make F7 just check the selected text?
  • Make F7 dialog work for DGV's

20130521
i00SpellCheck
  • Fixed bug that would occur when multiple textboxbases shared a context menu (found by Adviser)
  • DataGridView CellStyle no longer has to be set to WrapMode.True for corrections to appear in the DataGridView
  • Fixed a possible rendering issue where the error underlines would not be drawn in some instances
  • Fixed a possible bug where, on some rare occasions, the spell check dialog would error upon opening (found by TheComputerMan08 (Brent))
  • Fixed an issue where words starting with a capital were not getting picked up by the spell check
  • Fixed a bug where if selecting a new dictionary with the default ShowUIEditor function the control would not clear old correct words from cache
  • Now automatically spell checks controls in SplitContainers
FastColoredTextBoxPlugin
  • Added HTML example to FCTB with html color highlighting
  • Updated FCTB to latest version
  • Fixed an issue with FCTB where when inserting text all of the text would be spellchecked instead of just the visible range, speeding up large copy and pastes
HanksDictionaryTest
  • Added another example of using a different dictionary with i00 Spell Check ... Hanks Dictionary (by tewuapple (Hank))
WordDictionaryTest
  • Added another example of using a different dictionary with i00 Spell Check ... Word Dictionary


20130114
i00SpellCheck
  • Added engine to make more generic control extensions
  • Changed the workings of SpellCheckControlBase to use the more generic control extensions
  • Default dictionary load is now threadded even when just calling .SpellCheck
  • Control extensions can now specify multiple ControlTypes
  • Put the TextBoxBase change case feature into its own control extension
  • Put the nicer TextBoxBase context menu into its own control extension
  • Made the window animations smoother and more stable for F7 etc
  • Control extensions can now be dependant on other control extensions (like references but within control extensions)
TextBoxPrinter
  • Added TextBoxPrinter plugin
TextBoxSpeechRecognition
  • Added buttons to trigger dictate and speech
  • Custom Karaoke rendering control added to test form
  • Now uses the new, more generic, control extension rather than extending SpellCheckTextBox
  • Speech is no longer "broken up" at the end of each line in Windows 8
OSControlRenderer
  • Added OSControlRenderer plugin
SelectedControlHighlight
  • Added SelectedControlHighlight plugin
TextBoxTranslator
  • Added TextBoxTranslator plugin
Test
  • Neatened up Draft Plan rendering


20121102
i00SpellCheck
  • Made SpellCheckDialog more universal (so it can be used with other controls more easily)
  • Fixed a bug when using the SpellCheckDialog to spell check where the textbox would flicker and repaint several times upon confirming the changes
  • Added IgnoreWordsInUpperCase setting (requested by TheMperor)
  • Added IgnoreWordsWithNumbers setting (requested by TheMperor)
  • Fixed a bug that would cause the balloon tooltip to stuffup if it was on a screen to the left of the primary screen, this could cause the spell check dialog to crash
Test
  • Added some options to the Performance Monitor window
  • OpenOfficeHunspellDictionary
  • Hunspell now has case error underlineing
  • Added Hunspell syninoum lookup to Hunspell test project
TextBoxSpeechRecognition
  • Tray icon appears when using speech
  • Added a karaoke style content menu item when speaking
  • Now when triggering speek or dictate all instances of speech (across all applications that use i00 spell check) are terminated so that you can't get "multiple people" talking at once

20120920
  • Added performance counter
  • Fixed a bug with the built in dictionary where the dictionary index would be filled up with user words and potentially cause errors, this also has speed up spellchecking a lot
  • Fixed an issue with the spell check dialog, if you had alot of data it would "freeze"

20120914
  • Added Redo to context menu for rich text boxes
  • Changed the way the items are added to the spell check text box content menus to make them more expandable
  • TextBoxSpeechRecognition now adds menu items to TextBoxBase context menus
  • Added properties to TextBoxSpeechRecognition to adjust various settings
  • Fixed a bug that would cause an error when getting sugguestions for a word, where no suggestions could be made

20120907
  • Removed some redundant stuff from the project
  • Added a button to the test form that brings up the dictionary editor
  • Changed the way the flat files dictionary index is stored
  • Changed the way the flat files dictionary is stored in memory
  • Changed the dictionary alot to allow for easy user dictionary creation for inherreted dictionary classes
  • Changed the way the dictionary is indexed
  • Added a C# test project
  • Added a test project to demonstrate how people can use other spelling engines in i00 Spell Check. Hunspell in this case which has support for open office dictionaries

20120903
  • Added SpellCheckControlAdding event that allows you to pass back e.Cancel = True to prevent the control from being checked
  • Fixed a bug that could produce an error if you call .EnableSpellCheck multiple times on several forms (found by rfreedlund)
  • Indexed dictionary - added slightly to the initial loading time... but sped up checking significantly (requested by Maverickz)
  • Fixed a rare occuring bug where an error would be thrown with the spellcheck cache
  • User dictionary file is now separate from the built in dictionary
  • Ignored words are now stored in the user dictionary
  • Updated the FlatFile dictionary editor to support the new user dictionary
  • Added i00Binding List to the project for the FlatFile Dictionary editor... you can remove the reference, if you want, but will first have to remove the dictionary editor if you don't require it (found in i00SpellCheck\Spell Check\Engine\Dictionary\Flat File\Editor)
  • Changed the dictionary dramatically to support custom classes to enable the checking of other dictionary formats
  • Added a plugin that extends the SpellCheckTextbox, adding voice recognition to it! However Microsoft's inbuilt speech recognition isn't great. Press F12 twice quickly to perform speech recognition
  • Made built in plugins more extendable

20120625
  • Changed the way the words get added to the dictionary cache (increased spell checking speed)
  • Improved the speed of the FastColoredTextBox Plugin
  • Made the test project automatically pickup any plugins in the project path and add them to tabs automatically - the references to the plugins are not required, they were added for the LabelPlugin and FastColoredTextBoxPlugin so that they automatically get placed in the same folder when the project is built!

20120622 - FastColoredTextBox
  • Changed some internal workings of the spell checker
  • Added support for FastColoredTextBox with included plugin!

20120618 - Plugins!
  • Added test plugin to project that grants the ability to spell check labels
  • Changed the structure / inner workings of the spell check alot / made the spell check more modular and plugins possible!
  • Fixed a bug where the settings were not being applied under certain circumstances to spell check controls
  • Grid view spell checking now is shown on cells even when their not being edited

20120609 - DataGridView's are go!
  • Added support for DataGridViews (requested by in2tech)
  • Fixed a bug where the underlines would not draw in the correct positions when word wrapping is disabled
  • Fixed a bug where single line TextBoxes would not always show spelling errors

20120608 - Disabling and bug fixes
  • Fixed a bug where if you had an apostrophe at the start of a word it would push the underline spacing out (found by jwinney)
  • Added ability to disable the spell check on a TextBox (requested by Gabriel X)
  • Fixed a bug where the standard TextBox was not refreshing properly since the new rendering method was added
  • Fixed bug where if a TextBox contained errors and all text was deleted the underlines would still show (found by jim400)
  • Some minor interface changes with splash screen and "alt" for menu
  • Fixed up an issue where if you put a tab in a TextBox it would treat the tab as a word character (found by Santa's Little Helper)

20120203
  • Tooltips now have image support and images for some definitions
  • Fixed tool tip rendering issues
  • You can now press F3 to change case of the selected text (requested by rykk)
  • Made "-" be classified as a word break char
  • Fixed an error that would re-paint the textbox errors 2x
  • Disabled Cut/Copy/Paste options in menu if not on an STA thread as this would error

20120102 - Happy New Year!
  • Modified definitions to lookup from file dynamically rather than being loaded into memory to reduce RAM usage ~56MB saved!
  • Changed settings so that all the spellcheck settings are in a single class
  • Cleaned up the SpellCheckTextBox class and subclasses to make settings easily editable with a property grid
  • Added property grid to the test project
  • Added a dictionary editor
  • Added a "bare-bones" test project to the solution, to make it simpler for users to see how easy it can be to use i00 .Net Spell Check in your projects!
  • Changed the render method to eliminate redraw flicker, added a setting to revert to the old render method "RenderCompatibility"

20111202 - Now with dialog!
  • Cleaned up some stuff ... moved HTML formated tooltip + HTML ToolStripItem into their own controls
  • Made the Text ToolStripSeperator look and function better
  • Made the right click menu items portable so that they can be added to any menu for other things - not so tightly bound to the text box
  • Implemented a spell check dialog for F7 style spell checking (select text box and press F7!... can also be called with: TextBoxName.SpellCheck.ShowDialog())

20111109 - In-menu definitions, synonyms and fixes!
  • Changed tooltip definitions to match more words from their word base eg "suggestions" matches "suggestion" for definition since no definition is matched explicitly for suggestions and states that it is plural in the tip
  • Tooltip for definitions is now owner draw so that it appears a little nicer
  • Fixed a case matching bug where "Tihs" would suggest "this" rather than "This" (found by TxDeadhead)
  • Words like "Chirs's" now suggest "Chris'" instead of "Chris's"
  • Words that end in an ' no longer appear as being misspelled
  • Made the context menu position itself a little better if near the bottom or right sides of a screen
  • Fixed a bug where, if you press the context menu button on the keyboard multiple times, the menu would add multiple of the same corrections to the context menu
  • Sped up loading of dictionary file
  • Fixed a bug in the definition file - all adjectives and adverbs were mixed up (ie all adjectives were listed as adverbs, and all adverbs were listed as adjectives)!
  • Various speed optimizations in finding word suggestions, to lookup misspelled word "sugguestions" used to take ~250ms, now down to ~150ms
  • Improved suggestion lookup now adds higher weight to words with extra duplicates or missing duplicates (such as "runing", "runnning" > "running")
  • Added in-context-menu definitions for correctly spelled words (requested by Dean)
  • Words with interesting cases (such as SUpport, SupporT etc) now get picked up (requested by TxDeadhead)
  • Now doesn't fall over if the dictionary, definitions or synonyms files have been removed - just removes functionality for that bit
  • Added synonyms; "Change to..." menu item(requested by NtEditor)

20111106 - Been busy!
  • Various speed optimizations
  • Dictionary is now stored as a Flat File for portability
  • Added owner draw support for spelling errors
  • Added the ability to customize colors for highlighting misspelled words
  • Added some examples of how to customize the appearance of the spell check
  • Word definitions added for spelling suggestions ... so if you are unsure of the correct spelling out of the suggestions you can pick the correct one from the definition
  • The right click menu in .Net comes up from the middle of a text box when pressing the context menu button on the keyboard - It has now been modified to pop-out from the carets location
  • Cross word generator - plan to make solver later too!
  • Support added for Rich Text Boxes
  • Added Suggestion Lookup Example

20111011 - Some fun extras
  • Added anagram lookup
  • Added Scrabble helper

20111008 - Minor changes
  • Fixed a bug where the text box underlines would not always draw initially until the textbox was scrolled or had some text changed,
  • Cleaned up the interface to made it look more professional

20111006 - Initial Release
 
Last edited:

kareninstructor

Karen Payne MVP
Joined
Jun 26, 2008
Messages
6,520
Re: i00 .Net Spell Check - No 3rd party components required!

Regarding the import statement, once you have added any DLL to the project references then check the reference under Imported References (on the Reference tab) you may not need the import statement unless there is a clash with another DLL's namespace.
 

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

NOTE: I have put this in it's own post as i have run out of room in the main one (has a char limit)

Users

i00 (Kris), YafMan, TxDeadhead (Eric), erictam, Polyview, rykk, mrbungle74, skydiver1989ss, jim400, zombietom, SteveHeather, PatnLongBeach, Tim-MTI, lironmiron, KumaranA, radwen, MacShand, s0nlt, Programmer99, Ammar_Ahmad, Jimmy0, Steve Maier, Finbarr (Fin), daveha, Roger Templeton, Emmery Chrisco, Member 3938798, SuperiorCodingMan, kyle pantall, Simon Crowe, ILikeCake, DavidTheProgrammer, crb9000, StupidBomb, pjcobie, Member 8158784, Member 7937192, Member 2262881 (POSabilities Inc.), Member 9401932, BCantor, Jim Meadors, Member 4000809, yefi1455, fredatcodeproject, adils.kiet, Member 8597942, Martz, rfreedlund, dev1287, Member 7954771, Kebrite, Sahil Kanjwani, Member 1369511, TheMperor, Rod A B, Neil Wallace, Member 7676097, E Hindle, tewuapple, D@rwin, SherMags, Member 2986729, Member 2388257, stillflyinghigh, pwned555, KasukuK, Jamie Balfour, Member 8022205, Wafdof, jesseFromSD, Vitaly Pozharov, Globin, nbgangsta, Gagan1118, mfair, hassanlou, reeselmiller2, gcode1, Member 9400237, Crile Crisler, jspano, Hector Rodriguez, TheComputerMan08(Brent), bobiew, Member 1942993, RyanH88, millie33, Sander van H, Member 9975355, BruceG, Corum Ian Halligan, Jim Hersey II, Abinash Bishoyi, xiaobinzhang, hoodch, thomasbovard, jenrenee, Member 10116626, Bondos (Mark Bond), Vader_Oz, DuncanA, Paulo Lopo, tj_m16, Alonesome, Ricks_ideas, mksbala, carlos canales, TimFlan, ConMetMike, notnewcivilman, dave telfer, maitoti, drkajun, ShaggyJim, Nathan Lecompte, rivierabrian, IvyNeg, Member 10337586, Member 10450097, Member 10451799, Kieran Crown, Member 10499080, mimco99, tutor (rob), danpomeroy, Member 9506358
 
Last edited:

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

something is missing from the walkthrough :
this line : Imports SpellCheck.i00SpellCheck
it means some files are needed to be added to the solution explorer or some dll reference ?
could you please complete the walkthrough
What do you mean? SpellCheck.i00SpellCheck is in the project in the zip file!

SpellCheck is the project namespace and i00SpellCheck is the Namespace in the classes in the "SpellCheck\Spell Check" folder in the zip

Kris

Regarding the import statement, once you have added any DLL to the project references then check the reference under Imported References (on the Reference tab) you may not need the import statement unless there is a clash with another DLL's namespace.
There are NO imported dll's (outside the built in .Net ones) - where are you guys getting this from (LOL)???

And I have the extensions in a namespace within my project ... because they are extensions the imports statement is necessary.

Here is a list of references from my project:
System
System.Core
System.Data
System.Data.DataSetExtensions
System.Deployment
System.Design
System.Drawing
System.Windows.Forms
System.Xml
System.Xml.Linq

Edit: Even these are excessive ... as these are the standard imports when creating a new Forms project... so I have highlighted in bold the 5 that are actually needed.

Kris

something is missing from the walkthrough :
this line : Imports SpellCheck.i00SpellCheck
it means some files are needed to be added to the solution explorer or some dll reference ?
could you please complete the walkthrough
Ahh ... i re-read your post and think i mis-understood you before...

Edit: I updated the OP with details about referencing the project

Kris
 
Last edited:

kareninstructor

Karen Payne MVP
Joined
Jun 26, 2008
Messages
6,520
Re: i00 .Net Spell Check - No 3rd party components required!

There are NO imported dll's (outside the built in .Net ones) - where are you guys getting this from (LOL)???

Here from your first post
Code:
Imports SpellCheck.i00SpellCheck

In regards to my reply (which indicates I have not even downloaded the library) about Imported Namespaces, never said there was one.
 

kareninstructor

Karen Payne MVP
Joined
Jun 26, 2008
Messages
6,520
Re: i00 .Net Spell Check - No 3rd party components required!

Okay I see now after downloading the solution, works as instructed. What I would suggest is creating a DLL project for the Spell Checker so that all one needs to do is add the DLL to their project to use it.

If you want, the Import statement can be removed as per my first reply so we can do this and all works the same as having the Import statement.
Code:
[COLOR="SeaGreen"]'Imports SpellCheck.i00SpellCheck[/COLOR]
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ''do not select the text
        TextBox1.SelectionStart = 0
        TextBox1.SelectionLength = 0
 

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

Okay I see now after downloading the solution, works as instructed. What I would suggest is creating a DLL project for the Spell Checker so that all one needs to do is add the DLL to their project to use it.

If you want, the Import statement can be removed as per my first reply so we can do this and all works the same as having the Import statement.
Code:
[COLOR="SeaGreen"]'Imports SpellCheck.i00SpellCheck[/COLOR]
Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ''do not select the text
        TextBox1.SelectionStart = 0
        TextBox1.SelectionLength = 0
You don't need a dll, just reference the EXE, and I use the namespace inside my custom i00CodeLib exe because there is alot more than just a spell check in there :)

Kris
 

moti barski

Banned
Joined
Mar 25, 2009
Messages
764
Re: i00 .Net Spell Check - No 3rd party components required!

reference my exe file that is output from this project
add this 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
how to "reference your exe file that is output from this project and add this project to my solution and reference it" ? step by step plz

I know of the reference technchniques :
1 (project, add reference, choose dll) + an imports statement
2 add classes to the solution explorer then use subs form those classes,
but as for the above I'd like a noob explanation if possible

next :
"the code below may change if you used option 3 to "Imports YourProject.i00SpellCheck")"
what is option 3 ? how would the code below change ? and where to put the dictionary ?

the rest I understood.

also, I agree a dll would also be cool.
 
Last edited:

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

how to "reference your exe file that is output from this project and add this project to my solution and reference it" ? step by step plz

I know of the reference technchniques :
1 (project, add reference, choose dll) + an imports statement
2 add classes to the solution explorer then use subs form those classes,
but as for the above I'd like a noob explanation if possible

next :
"the code below may change if you used option 3 to "Imports YourProject.i00SpellCheck")"
what is option 3 ? how would the code below change ? and where to put the dictionary ?

the rest I understood.

also, I agree a dll would also be cool.
Ok... on the add reference window select browse then select "SpellCheck.exe"

I prefer referencing exe files because then you can have test harnesses with in each component that the end user can run for debugging.

Kris
 

Nightwalker83

PowerPoster
Joined
Dec 26, 2001
Messages
13,346
Re: i00 .Net Spell Check - No 3rd party components required!

Nice! Although, I would removed this line from the first post if I were you.

DO NOT RE-DISTRIBUTE THIS SOURCE CODE PARTLY OR IN ITS ENTIRETY

Since it is an example that is why you are posting the code so people may use it. Also, you can not say what you have said above when you also say:

entirely open source

That implies that people may use the project however they wish.
 

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

Nice! Although, I would removed this line from the first post if I were you.



Since it is an example that is why you are posting the code so people may use it. Also, you can not say what you have said above when you also say:



That implies that people may use the project however they wish.

No it means you can use it in your projects ... but if you want to redistribute the source for that app you will need to pre-compile the i00 spell check bit and reference that

Also "entirely open source" means that there are no "closed" components in the project - the user has access to everything!

Kris
 
Last edited:

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

Ok... updated...

  • fixed a bug where the text box underlines would not always draw initially until the textbox was scrolled or had some text changed,
  • and cleaned up the interface to made it look more professional

Kris
 

FreeNoob

New member
Joined
Jun 3, 2011
Messages
92
Re: i00 .Net Spell Check - No 3rd party components required!

This looks nifty I am downloading it in case I need something like this in the future, thanks ^.^
 

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

Will post an update within the next 48 hours with an anagram lookup and scrabble helper:)

Kris
 
Last edited:

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
New version is out :)

Now with promised scrabble helper and anagram lookup :)

Things to do now:
  • Boggle solver
  • Crossword solver
  • Definition lookup
  • Spell check interface - current spell check only accessed through right click menus
  • Auto correct based on some rules

Kris
 

YafMan

New member
Joined
Oct 17, 2011
Messages
1
Re: i00 .Net Spell Check - No 3rd party components required!

I am using i00 Spell check in my project.

It is the first time that I am trying to download a code here that I think can help me in my project. I think this spell checker may be useful.

Thanks for the post.
 
  • Like
Reactions: i00

Radjesh Klauke

PowerPoster
Joined
Dec 13, 2005
Messages
2,244
Re: i00 .Net Spell Check - No 3rd party components required!

Ola, was just checking this quickly. Is there a way to add multiple dictionaries (languages) and switch between them?
 

i00

PowerPoster
Joined
Mar 1, 2002
Messages
2,347
Re: i00 .Net Spell Check - No 3rd party components required!

Ola, was just checking this quickly. Is there a way to add multiple dictionaries (languages) and switch between them?
Yes you can ... to create a dictionary from scratch:

[highlight=vb] Dim Dictionary = New i00SpellCheck.SpellCheckTextBox.Dictionary("c:\Custom.dic", True)
Dictionary.Add("CustomWord1")
Dictionary.Add("CustomWord2")
Dictionary.Add("CustomWord3")
Dictionary.Save()[/highlight]

To then load a saved dictionary:

[highlight=vb]Dim Dictionary = New i00SpellCheck.SpellCheckTextBox.Dictionary("c:\Custom.dic")[/highlight]

To change dictionaries:
... for all text boxes:
[highlight=vb]'Set the dictionary:
i00SpellCheck.SpellCheckTextBox.DefaultDictionary = Dictionary
'update the highlights:
For Each item In i00SpellCheck.SpellCheckTextBoxes
item.Value.RepaintTextBox()
Next
[/highlight]

For an individual textbox:

[highlight=vb]'Set the dictionary:
TextBox1.SpellCheck.CurrentDictionary = Dictionary
'update the highlights:
TextBox1.RepaintTextBox()
[/highlight]

EDIT: you may need to also clear the dictionary cache's ... didn't think of this when I changed it to cache items to do this clear out
dictCache ... you may need to expose it first then call .clear ... will change this in next version if you need to do this, so let me know if you do

Thanks
Kris :)
 
Last edited:
Top