DBSRichViewEdit - Keep zoom when switching to the next doc

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
Posts: 1
Joined: Wed Nov 30, 2016 2:54 pm

DBSRichViewEdit - Keep zoom when switching to the next doc

Post by TJ_NOR »

I am using the component to show documents. If i am zooming out and go to my next document i the database the zoom jumps back to 100%
What can i do to solve it? I have tried to keep track of the zoom with a variable but haven't found a event where i can set it back properly.


Sergey Tkachenko
Site Admin
Posts: 15238
Joined: Sat Aug 27, 2005 10:28 am

Post by Sergey Tkachenko »

I suggest to process TDBSRichViewEdit.OnZoomChanged to store the last chosen ZoomPercent, and apply it in TDataSet.AfterScroll:

Code: Select all

ZoomPercent: Single; // defined in the form, initial value 0

procedure TForm1.DBSRichViewEdit1ZoomChanged(Sender: TObject);
  ZoomPercent := DBSRichViewEdit1.ViewProperty.ZoomPercent;

procedure TForm1.FDTable1AfterScroll(DataSet: TDataSet);
  if ZoomPercent > 0 then
    DBSRichViewEdit1.ViewProperty.ZoomPercent := ZoomPercent;

Post Reply