Hide specific toolbar tab



Is there a way of closing a specific tab on a toolbar (see below)?


We would like to run this as part of loading like this when we are updating our plug-in to insure the user has no duplicate toolbars.

I can get a hold of the nested Toolbar in the ToolbarFile but I’m a little lost as what to do after this.

protected override Result RunCommand(RhinoDoc doc, RunMode mode)
            // Try to close our toolbar tab in other toolbarfiles

            // Test code
            var tester = RhinoApp.ToolbarFiles.FindByName("TEST",false);
            var group = tester.GetToolbar(0);
            // End Test Code

            int toolbars = RhinoApp.ToolbarFiles.Count;
            IEnumerable<int> barlist = Enumerable.Range(0, RhinoApp.ToolbarFiles.Count);

            foreach(int bar in barlist)

                ToolbarFile testt = RhinoApp.ToolbarFiles.ElementAt(bar);
                IEnumerable<int> toolbarTabs = Enumerable.Range(0, testt.ToolbarCount);
                string output = testt.Name;

                if (testt.Name == "TEST")
                { }
                    foreach (int tab in toolbarTabs)
                        Toolbar tabtool = testt.GetToolbar(tab);

                        if(tabtool.Name == "TestToolbar")
                            var inter = tabtool.Id;

                        string tabName = tabtool.Name;


            RhinoApp.WriteLine("Command Worked!", EnglishName);
            return Result.Success;

Hope this is possible.
Best Morten