Scroll Past end of document with BottomMargin

General TRichView support forum. Please post your questions here
Post Reply
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Scroll Past end of document with BottomMargin

Post by jgkoehn »

I am working on getting a RVEdit to scroll until a checkpoint lines up with the top of a RVEdit view.
As recommended elsewhere I am using BottomMargin.

Code: Select all

        Y := 0;
          if RVData is TRvTableCellData then
            (RVData as TRvTableCellData).GetOrigin(X, Y);

          Y := RVData.GetCheckPointYEx(CPD) + Y;

          if Y > (rv.DocumentHeight - ((rv.ClientHeight div 10)*9)) then begin
             rv.BottomMargin := ((rv.ClientHeight div 10)*9);
          end else begin
             rv.BottomMargin := OrgBottomMargin;
          end;
          //rv.RefreshAll;
          //rv.FormatTail;

          rv.ScrollTo(Y);
          
However, I don't see the BottomMargin changing at all. What am I doing wrong?
Sergey Tkachenko
Site Admin
Posts: 17524
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: Scroll Past end of document with BottomMargin

Post by Sergey Tkachenko »

After changing BottomMargin, call Format (or Reformat, if the document is already formatted)
jgkoehn
Posts: 303
Joined: Thu Feb 20, 2020 9:32 pm

Re: Scroll Past end of document with BottomMargin

Post by jgkoehn »

Thanks sir works well.
Post Reply