In C # I have a RichTextbox, inside it has several lines, what I want to do is to select all text within a given 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, the index is the number of the line and Lenght is what will tell 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 get clearer, I need to do this:
1
2
3 eu quero selecionar todo esse texto
4
How can I get the current of a certain row of the richTextBox and within this chain select all text? and not "only" the first line?