How to create a toolbar and add it to Designer

Stimulsoft Reports.NET discussion
Post Reply
mikecity
Posts: 1
Joined: Thu Aug 28, 2014 8:24 am

How to create a toolbar and add it to Designer

Post by mikecity »

Hello!!

few days ago I created some buttons and added them to existing toolbars like this way:

Code: Select all

Stimulsoft.Report.Design.Toolbars.StiStandardToolbarService.GetService().AddToolButton("Clear", OnClearClick);

private void OnClearClick(object sender, EventArgs e)
        {
            stiReport.Pages[0].Components.Clear();
            stiReport.Designer.Refresh();
        }
this works fine!

Now i wonder if is it posible to create a new toolbar and add my own buttons on it.

Thank You.
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: How to create a toolbar and add it to Designer

Post by Alex K. »

Hello,

Unfortunately, it is not possible. You can add it only from the source code.

Thank you.
Saus86
Posts: 62
Joined: Fri Mar 23, 2012 10:57 am
Location: Italy

Re: How to create a toolbar and add it to Designer

Post by Saus86 »

I tried this code but it doesn't function. I didn't see the button.

Code: Select all

 private void button1_Click(object sender, EventArgs e) //StiStandardToolbarService
 {            
            //Add button in designer            
            Stimulsoft.Report.Design.Toolbars. StiStandardToolbarService.GetService().AddToolButton("Clear", OnClearClick);
            stiReport = new StiReport();            
            stiReport.Design();                       
}
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to create a toolbar and add it to Designer

Post by HighAley »

Hello.

Could you specify what button do you need to add and what Designer do you use?
It's possible to make changes in some themes of Designer control.
It's impossible to make such changes if you call the Designer with Design() method.

Thank you.
Saus86
Posts: 62
Joined: Fri Mar 23, 2012 10:57 am
Location: Italy

Re: How to create a toolbar and add it to Designer

Post by Saus86 »

I would specify a custom button like above.

Code: Select all

private void OnClearClick(object sender, EventArgs e)
        {
            stiReport.Pages[0].Components.Clear();
            stiReport.Designer.Refresh();
        }
The Designer used is 2012.2. How do I have to call Designer??

Thank you
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to create a toolbar and add it to Designer

Post by HighAley »

Hello.

Unfortunately, it's impossible to do this way.

Thank you.
Saus86
Posts: 62
Joined: Fri Mar 23, 2012 10:57 am
Location: Italy

Re: How to create a toolbar and add it to Designer

Post by Saus86 »

Sorry, but how mikecity did to add the new button inside Designer??
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: How to create a toolbar and add it to Designer

Post by HighAley »

Hello.

You could add a custom button on the StandardToolBar of the StiDesignerControl only before creating of that control with next code:

Code: Select all

StiStandardToolbarService stdToolbar = StiStandardToolbarService.GetService();
stdToolbar.AddToolButton(this.imageList1, 17, "Open Report..", new System.EventHandler (this.mbiFileNewReport_Activate));
Thank you.
Post Reply