public void AddxHighlightStyle(string syntax, Color fore, Color back, FontStyle fontstyle) { rcvSetting.AddRow(syntax, fore, back, fontstyle); if (syntax != null && syntax != "") { KeyWordStyle style = new KeyWordStyle(fore, back, fontstyle, syntax); TextKeyWordStyles.Add(style); } }
private void fctb_TextChanged(object sender, TextChangedEventArgs e) { if (KeyWordHighLight) { //clear previous highlighting //e.ChangedRange.ClearStyle(RedStyle); //highlight tags //e.ChangedRange.SetStyle(RedStyle, "<[^>]+>"); //HighLightList.RangeSetStyle(e.ChangedRange); TextKeyWordStyles.RangeSetStyle(e.ChangedRange); //keyword highlighting //e.ChangedRange.SetStyle(BlueStyle, @"\b(abstract|as|base|bool|break|byte|case|catch|char|where|yield)\b|#region\b|#endregion\b"); } }