2014-01-22 29 views
-1

在文本框中的某些文本,我需要TextBoxasp.net当文本时,将输入(如Microsoft Word中拼写检查功能)发生某些事件突出显示某些文本。突出asp.net

我一直在使用freetextbox,它突出显示按钮上的文字,但不会自动点击。

如何做到这一点?
我应该使用其他控件吗?

+0

你能举一个“特定事件”的例子吗? –

+0

可能的重复http://stackoverflow.com/questions/21257663/automatic-event-firing-in-a-textbox-while-text-is-being-typed –

+0

为拼写检查 –

回答

-1

你可以使用jquery并检查每个按键,当你的单词组合被满足时,你可以使用CSS来突出显示文本。

功能.keypress() - more on keypress

0

可以使用RichTextBox做这件事。
使用RichTextBox,您可以彩色或高亮显示单行或单词。

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

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

查看本教程的link