Print preview full screen - my _no-code_ solution
I made a ppReport descendant that publishes a MaximizePreviewWindow
property. So, I just set it to true at design time and my preview windows
are maximized. Here is the class code:
TAprReport = class(TppReport)
private
FMaximizePreview: Boolean;
protected
procedure DoOnPreviewFormCreate; override;
public
constructor Create(aOwner: TComponent); override;
published
property MaximizePreviewWindow: Boolean read FMaximizePreview write
FMaximizePreview default True;
end;
{ TAprReport }
constructor TAprReport.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
AllowPrintToFile:=True;
FMaximizePreview:=True;
end;
procedure TAprReport.DoOnPreviewFormCreate;
begin
if FMaximizePreview then begin
PreviewForm.WindowState := wsMaximized;
TppViewer(PreviewForm.Viewer).ZoomSetting := zs100Percent;
end;
end;
property. So, I just set it to true at design time and my preview windows
are maximized. Here is the class code:
TAprReport = class(TppReport)
private
FMaximizePreview: Boolean;
protected
procedure DoOnPreviewFormCreate; override;
public
constructor Create(aOwner: TComponent); override;
published
property MaximizePreviewWindow: Boolean read FMaximizePreview write
FMaximizePreview default True;
end;
{ TAprReport }
constructor TAprReport.Create(aOwner: TComponent);
begin
inherited Create(aOwner);
AllowPrintToFile:=True;
FMaximizePreview:=True;
end;
procedure TAprReport.DoOnPreviewFormCreate;
begin
if FMaximizePreview then begin
PreviewForm.WindowState := wsMaximized;
TppViewer(PreviewForm.Viewer).ZoomSetting := zs100Percent;
end;
end;
This discussion has been closed.