Hi
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.
TJ
DBSRichViewEdit - Keep zoom when switching to the next doc
-
- Site Admin
- Posts: 17524
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
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);
begin
ZoomPercent := DBSRichViewEdit1.ViewProperty.ZoomPercent;
end;
procedure TForm1.FDTable1AfterScroll(DataSet: TDataSet);
begin
if ZoomPercent > 0 then
DBSRichViewEdit1.ViewProperty.ZoomPercent := ZoomPercent;
end;