Cursor goes to top after inserting text

General TRichView support forum. Please post your questions here
Post Reply
agent86
Posts: 59
Joined: Mon Jun 28, 2010 2:18 am
Location: San Francisco Bay Area, USA
Contact:

Cursor goes to top after inserting text

Post by agent86 »

Richview 13

After I add text to existing document with the following procedure the cursor jumps to the top of the document. Anyway to make the cursor go back where it was before the insertion?

Code: Select all

procedure TRetrieveAutoTextForm.AddReplacementText ;
var Stream: TMemoryStream;
 i : integer ;
begin
  Stream := TMemoryStream.Create;
  AutoTextPreviewDBRichView.SaveRVFToStream(Stream, False);
  Stream.Position := 0;
  i := ReportWriterMainForm.rve.ItemCount ;
  ReportWriterMainForm.rve.InsertRVFFromStreamEd(Stream); // was rve.InsertRVFFromStream(Stream, i )
  Stream.Free;
  ReportWriterMainForm.rve.Format;
end;
Sergey Tkachenko
Site Admin
Posts: 17566
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do not call Format after InsertRVFFromStreamEd.
InsertRVFFromStreamEd is an editing method, it makes all necessary formatting itself.
Post Reply