Page 1 of 1
Cannot change ChartController
Posted: Fri Jul 06, 2007 1:02 pm
by 9641691
Hello!
I cannot change images, buttons etc. in ChartController. I can, but it doesn't remember my configuration. And every time I reload my usercontrol in designer ChartController resets to its default state. And after changing items in ChartController nothing happens in usercontrol.designer.cs
The control is great but with opportunity to customize it.
P.S. I have the latest 3.0 ver. form 15th June 2007
Posted: Fri Jul 06, 2007 7:44 pm
by narcis
Hi hominoid,
Could you please send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://
www.steema.net/steema.public.attachments newsgroup or at our
upload page.
Thanks in advance.
Posted: Mon Jul 09, 2007 5:24 am
by 9641691
I've uploaded WindowsApplication5.rar from
kopylov@vast.spb.ru on
http://www.steema.net/upload/
Try to change any images in chartController1 (for example, pointer) and then run the project - image is not changed.
Posted: Mon Jul 09, 2007 9:05 am
by Chris
Hello!
In the TeeChart.Net v3 Feature demo there's an example:
All Features\Welcome !\Components\Commander\Custom Buttons
which shows you how to customize the commander. An example of how to do the same will be shipped with the next maintenance release, due out this week, which looks like this:
Code: Select all
private void InitialiseChart() {
const int buttonCount = 5;
#if VS2005
ToolStripItem[] comButtons = new ToolStripItem[buttonCount];
ToolStripButton tmpBut;
#else
ToolBarButton[] comButtons = new ToolBarButton[buttonCount];
#endif
#if VS2005
foreach (ToolStripItem button in commander1.Items)
#else
foreach (ToolBarButton button in commander1.Buttons)
#endif
{
#if VS2005
if (button is ToolStripButton)
{
tmpBut = button as ToolStripButton;
tmpBut.Checked = false;
#else
button.Pushed = false;
#endif
switch (button.Tag.ToString())
{
case "bNormal":
break;
#if !VS2005
case "bSeparator":
comButtons[1] = button;
comButtons[3] = button;
break;
#endif
case "bRotate":
#if VS2005
tmpBut.Checked = true;
#else
button.Pushed = true;
#endif
comButtons[0] = button;
break;
case "bMove":
break;
case "bZoom":
comButtons[2] = button;
break;
case "bDepth":
break;
case "bView3D":
break;
case "bEdit":
comButtons[4] = button;
break;
case "bPrint":
break;
case "bCopy":
break;
case "bExport":
break;
}
#if VS2005
}
else if (button is ToolStripSeparator)
{
switch (button.Tag.ToString())
{
case "bSeparator":
comButtons[1] = button;
comButtons[3] = button;
break;
}
}
#endif
}
#if VS2005
commander1.Items = comButtons;
#else
commander1.Buttons = comButtons;
#endif
commander1.Chart = tChart1;
line1.FillSampleValues();
}
I think that the ToolStripItem class has an Image property which you should be able to set to the image you desire.
Posted: Mon Jul 09, 2007 9:23 am
by 9641691
Yes, I know that ToolStripItem has Image property. May be it's possible to change it in the code, I'll try. But I like component designers as well and if there's an opportunity not to write code, but to to customize controls by clicking mouse - I'd prefer mouse. I just want to point out that ChartController's designer doesn't work properly.
Posted: Mon Jul 09, 2007 9:44 am
by Chris
Hello,
I just want to point out that ChartController's designer doesn't work properly.
Thank you for pointing that out to us, we will look into it. In the meantime I hope that using the few lines of runtime code I sent you will be ok for you.
Posted: Mon Jul 09, 2007 9:50 am
by 9641691
You are welcome! I really like TeeChart and want to help make it better!
Posted: Mon Jul 09, 2007 9:55 am
by Chris
Hello,
You are welcome! I really like TeeChart and want to help make it better!
That really is very kind of you. It is always a pleasure working with TeeCharters such as yourself!