Page 1 of 1
How to create a toolbar and add it to Designer
Posted: Thu Aug 28, 2014 8:41 am
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.
Re: How to create a toolbar and add it to Designer
Posted: Fri Aug 29, 2014 7:37 am
by Alex K.
Hello,
Unfortunately, it is not possible. You can add it only from the source code.
Thank you.
Re: How to create a toolbar and add it to Designer
Posted: Thu Sep 24, 2015 1:05 pm
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();
}
Re: How to create a toolbar and add it to Designer
Posted: Fri Sep 25, 2015 7:11 am
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.
Re: How to create a toolbar and add it to Designer
Posted: Fri Sep 25, 2015 7:41 am
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
Re: How to create a toolbar and add it to Designer
Posted: Fri Sep 25, 2015 8:54 am
by HighAley
Hello.
Unfortunately, it's impossible to do this way.
Thank you.
Re: How to create a toolbar and add it to Designer
Posted: Fri Sep 25, 2015 11:10 am
by Saus86
Sorry, but how mikecity did to add the new button inside Designer??
Re: How to create a toolbar and add it to Designer
Posted: Fri Sep 25, 2015 11:55 am
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.