How to color sections of a RichTextBox differently?
string text = "a b c d teste";
// words to highlight
string[] word = { "a", "b", "c", "d" };
// colors to use, aligned with words above
Color[] color = { Color.Red, Color.Blue, Color.BlueViolet, Color.Brown };
for(int c = 0,size = word.Length; c < size; c++) {
//search by color[x] and set line color to color[x]
//How I do this?
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…