with RichEdit1 do begin
Lines.BeginUpdate;
try
SelStart := ...;
SelLenght := ...;
with SetAttributes do begin
Color := ...;
Style := ...;
end;
finally
Lines.EndUpdate;
end;
end;
procedure TForm1.RichEdit1Change(Sender: TObject);
var
Temp: Integer;
begin
with RichEdit1 do
if Tag = 0 then begin
Tag := 1;
Lines.BeginUpdate;
try
Temp := SelStart;
SelStart := 0;
SelLength := temp;
SelAttributes.Color := clRed;
SelLength := 0;
SelStart:= Temp;
finally
Lines.EndUpdate;
Tag := 0;
end;
end;
end;
to:JohnsonGuo
You method is OK! thanks very much!
another problem: there still have some blink on the RichEdit control when I
press some key. can you have some method? but this time I have no fen to you.