Page 1 of 1

Adding button to toolbar v2015.3

Posted: Wed May 23, 2018 11:50 pm
by poweredbyporkers
How can I add a button to the preview windows toolbar? I can't find StiStandardToolbarService stdToolbar = StiStandardToolbarService.GetService() anywhere

Re: Adding button to toolbar v2015.3

Posted: Fri May 25, 2018 1:06 pm
by Lech Kulikowski
Hello,

Please check the following topic:
viewtopic.php?&t=2540

Thank you.

Re: Adding button to toolbar v2015.3

Posted: Tue May 29, 2018 1:56 am
by poweredbyporkers
Thanks for that although I went in a different direction but now I'm having an issue getting the tooltip i the same format as the existing buttons

Image Image

Code: Select all

        private void AddExportButton()
        {
            var exportButton = new ButtonItem
            {
                Text = "Export...",
                Name = "exportButton",
                BeginGroup = true 
            };

            exportButton.Shortcuts.Add(eShortcut.CtrlE);
            exportButton.Click += (s,e) =>
            {
                using (var exportDialog = new ReportExportDialog())
                {
                    exportDialog.StartPosition = FormStartPosition.CenterParent;
                    exportDialog.ShowDialog();
                }
            };

            viewerControl.ToolBar.Items.Insert(1, exportButton);
        }

Re: Adding button to toolbar v2015.3

Posted: Thu May 31, 2018 5:42 am
by Edward
Hi Poweredbyporkers,

In our older versions the following technique did work;
viewtopic.php?f=8&t=3165&p=13175
Could you please try a similar approach?

Thank you,
Edward