private void timer1_Tick(object sender, EventArgs e) { foreach (RichTextBox rtb in Editor.Values) { int pos = 0; foreach(string ln in rtb.Lines) { Color[] Syntax = EditorTools.ParseString(ln); int cur = 0; foreach (char chr in ln) { rtb.SelectionStart = pos; rtb.SelectionLength = 1; rtb.SelectionColor = Syntax[cur]; cur++; pos++; } } } }
public static Color[]ParseString(string raw) { int len = 0; foreach(char chr in raw) { len++; } Color[] ret = new Color[len]; string[] parsed = Regex.Split(raw, " "); for (int i = 0;i < len;i++) { ret[i] = Color.Green; } return ret; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)