Help - Search - Members - Calendar
Full Version: Add Custom button in Preview toolbar?
Fast Reports forum > Fast Reports Products > FastReport 4.0
aroberts
Can I add a custom button in the default Preview toolbar? If so, can you provide an example? Thanks.
gpi
CODE
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;
end;
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.