Hi!!!
I am making an window application in C# .NET, in which I want that when user enters any text in textbox and if there is spelling error then,the system should mark it with red line to tell the user that spelling is wrong.
Like here in forum when we type any wrong word then system automatically mark it with red line to tell user that spelling is to be corrected............
How can I add this functionality in my application for entering text in textbox...
Kindly provide me code if possible.........

hi,sknake
Thanks for your reply....
I read this article here, there they have made spell check and spellcheck control separately.
How can use only spell check code for my application where I have already have textbox etc. Can u tell me how to use this code in my application..............

What have you tried?

I tried to use the code :" public partial class SpellCheckTextControl : System.Windows.Forms.TextBox1 ................." on text_changed event of textBox1.

I have used the following code on text_changed event of textBox1


But its giving error for namespaces:
"using Microsoft.Office.Core;
using Microsoft.Office.Interop.Word;"

I have uploaded my application here......
Kindly help me regarding this.....

Do you have Microsoft office installed on your computer?

commented: Indeed, not everyone has! +8

yes I have Microsoft Office installed ..........And i have imported Office.dll in debug folder in my projects also.........
Kindly help me out........

there is a C++ library that is open source called "aspell". you may be able to wrap it in .net get all its functionality without the headache.

but as far as I understand, on the space, comma, semicolon and period key presses, you could split the text in the box getting its last word, compare it to a dictionary and get if its spelled right. in which case you could change its color or something in a rich text box. as far as the suggestions, that could be based on a regular expression algorithm, but idk what the standard method is.

It wold be nice if the next version of .net offered a ritchtextbox control with a spellcheck feature build in.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.