I am trying to remove a tool from the ribbon toolbar using C#. The code I am using is;
The error I get states;
"The best overloaded method match for 'Infragistics.Win.UltraWinToolbars.ToolsCollectionBase.Remove(Infragistics.Win.UltraWinToolbars.ToolBase)' has some invalid arguments."
Could you provide a C# sample code on how to do this?
Here is a sample that removes an instance tool ("Remove Tool on Ribbon" button code) and also removes the root instance tool ("Remove tool for good" button code).
The "Remove Tool on Ribbon" button will get rid of ButtonTool2 in the Ribbon's first tab and first tab group. You should note that the tool still exists in the Tools collection.
The "Remove tool for good" button will get rid of ButtonTool2 in the UltraToolbarsManager's Tools collection and as a result remove the instance tool on the Ribbon's first tab, tab group.
Further reading if you are interested (found here) has a nice description of root and instance tools (along with the shared props and instance props).
Matthew Kraft Windows Forms Platform Development LeadInfragistics, Inc.
Thanks, Matthew. Your sample worked great.