D
djks
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大侠,我的想法是这样:
当richedit2的内容等于richedit1的内容时,richedit1的字符串为红色。如果不等于
为黑色,并且发出警告声。( 我做的有点小问题。)
var Startpos,Toend,x,y:integer;
curstring:string;
begin
curstring:=RichEdit2.Lines[RichEdit2.Lines.Count-1];;
StartPos := 0;
ToEnd := length(Richedit1.text)-1;
X := Richedit1.FindText(curstring,StartPos,toEnd,[stMatchCase]);
if x<>-1 then
begin
Richedit1.SetFocus;
Richedit1.selstart := X;
RichEdit1.SelLength := Length(curstring);
RichEdit1.SelAttributes.Color:=clRed;
end;
当richedit2的内容等于richedit1的内容时,richedit1的字符串为红色。如果不等于
为黑色,并且发出警告声。( 我做的有点小问题。)
var Startpos,Toend,x,y:integer;
curstring:string;
begin
curstring:=RichEdit2.Lines[RichEdit2.Lines.Count-1];;
StartPos := 0;
ToEnd := length(Richedit1.text)-1;
X := Richedit1.FindText(curstring,StartPos,toEnd,[stMatchCase]);
if x<>-1 then
begin
Richedit1.SetFocus;
Richedit1.selstart := X;
RichEdit1.SelLength := Length(curstring);
RichEdit1.SelAttributes.Color:=clRed;
end;