Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
83
Remove tool from Ribbon toolbar in C#
posted

I am trying to remove a tool from the ribbon toolbar using C#. The code I am using is;

"toolbar_Ribbon.Tools.Remove(tool) 

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? 

Thank you.

 

Parents
  • 5118
    Verified Answer
    posted

    Hi,

    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). 

    ControlContainer.zip
Reply Children
No Data