Home General
New Blog Posts: Merging Reports - Part 1 and Part 2

Adding a SpeedButton in the Preview Form

edited July 2004 in General
Hi,

I'm using the PreviewFormCreate event to add a simple button to the toolbar
in the previewform. It's not really a toolbarbutton , it's a TButton layed
on the form - a fake. Now I want to add a SpeedButton. I tryed the same way
but no button is visible. All other components (edits, combos ...) are
working. What's wrong?
My source:

var
btn: TSpeedButton;
begin
btn := TSpeedButton.Create(Report.PreviewForm);
btn.Parent := Report.PreviewForm;
btn.Caption := 'Export';
btn.Top := 2;
btn.Left := 28;
btn.Height := 24;
btn.OnClick := ExportBtnClick;
end;


Regards
Sven Langenkamp

Tel.: +49 (0) 50 21 / 97 24 -15
Email: langenkamp@ctdatentechnik.de

===============================
CT Datentechnik Gesellschaft
f?r Prozessrechentechnik mbH
Eschenstr. 2 - 31582 Nienburg
Tel.: +49 (0) 50 21 / 97 24 -0
Fax: +49 (0) 50 21 / 97 24 -18
Email: info@ctdatentechnik.de
Internet: www.ctdatentechnik.de
===============================

Comments

  • edited July 2004
    Hi Sven,

    Take a look at the TppPreview.CreateToolbarControls procedure inside the
    ppPreview.pas file to see how the speed buttons are created in the current
    preview plugin. Af first glance, it looks as though you need to add the
    button to the toolbar, not the actual preview form. You may also need to
    reposition the other buttons and items on the toolbar so your new button
    will fit.

    --
    Thanks for supporting ReportBuilder! Please vote for ReportBuilder in the
    Delphi Informant Readers Choice awards!

    http://www.delphizine.com/ballot2004/

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
This discussion has been closed.