D
djks
Unregistered / Unconfirmed
GUEST, unregistred user!
当richedit2等于richedit1的字符串(汉字)richedit1相对应的字为红色:
var x,y:integer;
curstring:string;
begin
y:=RichEdit2.Lines.Count-1;
curstring:=RichEdit2.Lines[RichEdit2.Lines.Count-1];
x:=Length(curstring)+1;
RichEdit1.SelStart:=y;
RichEdit1.SelLength:=1;
RichEdit1.SelAttributes.Color:=clRed;
end;
var x,y:integer;
curstring:string;
begin
y:=RichEdit2.Lines.Count-1;
curstring:=RichEdit2.Lines[RichEdit2.Lines.Count-1];
x:=Length(curstring)+1;
RichEdit1.SelStart:=y;
RichEdit1.SelLength:=1;
RichEdit1.SelAttributes.Color:=clRed;
end;