Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add to a textbox the red line (like bad spelling in Word)?

Tags:

c#

.net

.net-2.0

How can we produce the effect of the red line under a bad spelling word like the image below :

alt text http://img505.imageshack.us/img505/7253/options285x395rg9.th.png

Update

I do not want to use Google or whatever spell program. I would like to know how to create the effect of the red line.

like image 545
Patrick Desjardins Avatar asked Oct 07 '08 16:10

Patrick Desjardins


People also ask

Why red squiggly underlines when words are not spelled wrong?

Perhaps the language was set up wrong in the paragraph style (in the Advanced Character Formats pane of the Edit Paragraph Styles dialog box), or perhaps someone just selected the wrong thing when moving too quickly.

Why are some words underlined in red?

Microsoft Word turns on Spell check and Grammar check by default. The red wavy underlines just mean flagged spelling errors and the green underlines mean flagged grammatical errors. However, the checking isn't always accurate, and that's why you may want to remove it.


1 Answers

You can do this using a RichTextBox control, which will allow you to set the underline style and underline color on any portion of text.

And here's an example doing exactly what you want to do.

like image 138
Ryan Avatar answered Sep 24 '22 01:09

Ryan