-1

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

我一直在使用freetextbox,它会在单击按钮时突出显示文本,但不会自动突出显示。

怎么做?
我应该使用其他控件吗?

4

2 回答 2

0

您可以使用 aRichTextBox来执行此操作。
使用RichTextBox,您可以为单行或单词着色或突出显示。

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

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

检查此链接以获取教程。

于 2014-01-22T09:40:07.243 回答
-1

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

功能是 .keypress() -更多关于按键

于 2014-01-22T09:36:09.567 回答