private void LoadKeys(Dictionary<string,List<string>> dictionary, string FileName)
{
string line = System.String.Empty;
using (StreamReader sr = new StreamReader(keywords))
{
while ((line = sr.ReadLine()) != null)
{
string[] tokens = line.Split(',');
dictionary.Add(tokens[0], tokens.Skip(1).ToList());
richTextBox2.AppendText("Url: " + tokens[0] + " --- " + "Localy KeyWord: " + tokens[1]+Environment.NewLine);
ColorText(richTextBox2, Color.Red);
}
}
}
And the function ColorText:
public void ColorText(RichTextBox box, Color color)
{
box.SelectionStart = box.TextLength; box.SelectionLength = 0;
box.SelectionColor = color;
box.SelectionColor = box.ForeColor;
}
But it didnt color anything in Red. Nothing changed.
I want to be able to color in Red for exmaple only the tokens[0] and in Green tokens[1] for example.
How can i do it ?
1 Answer