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
4133
Remove ButtonTool From Root Tool Collection After Removing From QuickAccessToolbar
posted

I am dynamically adding button tools to the root tool collection and to the QuickAccess toolbar in my app.  I am allowing the user to click the Customize button so they can turn off a button tool.  That command seems to remove the item from the QuickAccessToolbar, but it doesn't remove the tool from the root tool collection.  This makes sense because they are able to go back in and turn the tool on again if they choose.

When they close the form, I am looping through the tools and am trying to manually delete the tools I added, but I get an "object is not an instance of an object" error when I come upon a tool that the user turned off.  What is the proper way to remove an item from the root tool collection after the user has removed it from the QuickAccessToolbar?