I am sure this has been asked before but I could not find it.
How do I add a button to the chartcontroller next to the save button?
It has to be a open button so the user can both save and open a file.
I prefere do do it by code.
PS when I try to add a toolstripitem in design mode VS2015 shows a error: "Cannot create an abstract class"
Regards Torben
custom Open button on chartcontroller
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: custom Open button on chartcontroller
Hi Torben,
You should be able to control the items in the chartcontroller using code similar to that indicated in the answer to this post.
You should be able to control the items in the chartcontroller using code similar to that indicated in the answer to this post.
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: custom Open button on chartcontroller
Hi,
I dont understand how the single code line in the link helps me adding a custom button.
Can you give a simple code example that shows how to add a button next to the save button?
Regards Torben
I dont understand how the single code line in the link helps me adding a custom button.
Can you give a simple code example that shows how to add a button next to the save button?
Regards Torben
-
- Guru
- Posts: 1603
- Joined: Fri Nov 15, 2002 12:00 am
Re: custom Open button on chartcontroller
Hello Torben,
You could try:
You could try:
Code: Select all
private void button4_Click(object sender, EventArgs e)
{
ToolStripButton button = new ToolStripButton("My Button", Image.FromFile(@"D:\tmp\orion.png"), Button_Click);
button.ImageAlign = ContentAlignment.MiddleCenter;
button.ImageScaling = ToolStripItemImageScaling.SizeToFit;
((ToolStrip)chartController1).AutoSize = true;
((ToolStrip)chartController1).Items.Insert(((ToolStrip)chartController1).Items.Count - 1, button);
}
private void Button_Click(object sender, EventArgs e)
{
MessageBox.Show("Alnitak");
}
Best Regards,
Christopher Ireland / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Re: custom Open button on chartcontroller
Thanks. Just what I needed
Regards Torben
Regards Torben