2
In C# I have a Richtextbox, inside it has several lines, what I want to do is select all text within a certain line and color. What I’m doing is this:
richTextBox1.Select(0, richTextBox1.Lines[index].Length);
richTextBox1.SelectionColor = Color.Red;
Zero is the initial position of the text, index is the line number and Lenght is the one that will tell you the end of the selection within this line.
The problem is that it does not select the text of the current line, it always selects the text of the first line.
To be clearer, I need to do it in this style:
1
2
3 eu quero selecionar todo esse texto
4
How can I take the chain of a particular richTextBox line and within this chain select any text? and not "only" the first line?