using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.UserSkins;
using DevExpress.XtraEditors;
using DevExpress.XtraRichEdit.API.Native;
namespace WindowsApplication1
{
public partial class Form1 : XtraForm
{
public Form1()
{
InitializeComponent();
}
private void simpleButton1_Click(object sender, EventArgs e)
{
DocumentRange[] list = richEditControl1.Document.FindAll(new System.Text.RegularExpressions.Regex(@"str1|str2"));
for (int i = 0; i < list.Length; i++)
{
CharacterProperties cp = richEditControl1.Document.BeginUpdateCharacters(list[i]);
cp.ForeColor = Color.Red;
this.richEditControl1.Document.EndUpdateCharacters(cp);
}
}
}
}