How to hide buttons on ChartController

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Quant
Advanced
Posts: 142
Joined: Tue Dec 30, 2014 12:00 am

How to hide buttons on ChartController

Post by Quant » Tue Mar 10, 2015 6:03 am

I m using ChartController for my charts and i wanted to hide some buttons of it e.g. 3D, Zoom.
Help me find out how this can be achieved

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: How to hide buttons on ChartController

Post by Christopher » Tue Mar 10, 2015 9:36 am

Quant,

One way to achieve this which enables you to see what is going on is this:

Code: Select all

      ToolBarButton[] buttons = commander.Buttons;
      List<ToolBarButton> newButtons = new List<ToolBarButton>();
      foreach (ToolBarButton button in buttons)
      {
        if (!((string)button.Tag).Contains("Zoom") && !((string)button.Tag).Contains("3D"))
        {
          newButtons.Add(button);
        }
      }

      commander.Buttons = newButtons.ToArray();
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

Post Reply