Disable buttons on preview scrren

edited 4:00AM in FastReport 3.0
Can anyone help me how to disable buttons(save, edit) on preview screen? I do see some posts on this but I need actual code in Delphi.

Thanks

Comments

  • gpigpi
    edited 4:00AM
    uses frxClass, frxPreview, ComCtrls, ToolWin, Buttons;
    ...
    
    procedure TForm1.ButtonClick(Sender: TObject);
    begin
         ShowMessage('My Button pressed');
    end;
    
    procedure TForm1.frxReport1Preview(Sender: TObject);
    var
      Button: TSpeedButton;
    begin
      Button := TSpeedButton.Create(TfrxPreviewForm(frxReport1.PreviewForm).ToolBar);
      Button.Parent:=TfrxPreviewForm(frxReport1.PreviewForm).ToolBar;
      Button.Caption:='My Button';
      Button.Width:=60;
      Button.Left:=650;
      Button.OnClick:=ButtonClick;
      TfrxPreviewForm(frxReport1.PreviewForm).PrintB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).OpenB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).SaveB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).PrintB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).ExportB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).EmailB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).FindB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).Sep1.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).ZoomPlusB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).ZoomCB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).Sep3.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).ZoomMinusB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).FullScreenBtn.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).Sep2.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).OutlineB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).ThumbB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).PageSettingsB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).DesignerB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).Sep5.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).FirstB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).PriorB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).PageE.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).Sep4.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).NextB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).LastB.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).frTBPanel1.Visible:=False;
      TfrxPreviewForm(frxReport1.PreviewForm).CancelB.Visible:=False;
    end;
    

Leave a Comment