Is it possible to select multiple words(for eg: "The family live in a big house") and track those selected words?
If possible, how can i do it?
开发者_开发知识库Edit----
I need to select the words using the mouse and put those selected words in a string array.
What about the MouseUp-Event and the SelectedText-Property?
List<string> _Words;
private void richTextBox1_MouseUp(object sender, MouseEventArgs e)
{
richTextBox1.SelectionBackColor = Color.DeepPink;
_Words.Add(richTextBox1.SelectedText);
}
You can use a rich text box and set a highlighting background for each selection (similar to how IE, Firefox, etc will highlight all of the found search terms). You would have to scan the text and insert the highlighting yourself. You wouldn't be able to use the builtin selection properties of a textbox since the text isn't contiguous.
精彩评论