-1

I need TextBox in asp.net to highlight some text when certain event occurs while text is being typed (as in Microsoft Word spell check feature).

I have been using freetextbox, it highlights the text on a button click but not automatically.

How to do that?
Should I use another control?

Pratik Singhal
  • 6,283
  • 10
  • 55
  • 97
Bainu Singla
  • 21
  • 1
  • 8

2 Answers2

0

You can use a RichTextBox for doing it.
With RichTextBox, you can color or highligh single lines or words.

    // select characters from index 0 to 9
     richTextBox1.Select(0, 10);

   //will color the selected text.
   richTextBox1.SelectionColor = Color.Green;    

Check this link for a tutorial.

Pratik Singhal
  • 6,283
  • 10
  • 55
  • 97
-1

You can use jquery and check for each keypress, when your word combination is met you can use css to highlight text.

function is .keypress() - more on keypress

Lucky Lefty
  • 347
  • 1
  • 8