richTextBox1.Select(0, richTextBox1.Lines[0].Length);
richTextBox1.SelectionColor = Color.Red;
The first time only line 0 the first line in richTextBox1 is in Red. But i call this lines in a timer tick event each X seconds and on the next time it's coloring all the text in the richTextBox1 in Red.
How do i make that it will keep coloring in Red only the first line ? (Lines[0] )
EDIT
This is the full code in a method im calling the method each x seconds from a timer tick event:
private void CombindedStringFix()
{
scrollerList = new List<string>(TextExtractor.newTextWithoutLinks);
scrollerText = string.Join(Environment.NewLine, scrollerList);
combindedString = string.Join(Environment.NewLine, newText);
scroller1.TextToScroll = scrollerText;
richTextBox1.Text = combindedString.TrimStart();
richTextBox1.Refresh();
string[] rlines = richTextBox1.Lines;
richTextBox1.SelectionStart = 0;
richTextBox1.SelectionLength = rlines[0].Length;
richTextBox1.SelectionColor = Color.Red;
richTextBox1.Select(rlines[0].Length, rlines[1].Length + 1);
richTextBox1.SelectionColor = Color.Green;
}
First time it's coloring the top first line in red second top line in green fine. But in the next timer itertion it's coloring all the text in the richTextBox1 in Red.