Community
Showing results for 
Search instead for 
Do you mean 
Reply

Unable to remove button from Toolbar

Accepted Solution Solved
Copper Contributor
Posts: 42
Country: United States
Accepted Solution

Unable to remove button from Toolbar

[ Edited ]

I have tried numerous methods for removing a button from both the Contact Detail Toolbar and the Contact List Toolbar, but no matter what I do, the icons remain, even when the commands behind them are removed.

 

I believe this problem arose when Act froze and had to be hard stopped, but I can't be certain.  The issue appears to occur when I call this method:
 application.Explorer.CommandBarCollection["Contact List Toolbar"].ControlCollection.Remove

 

I retrieve the CommandBarControl in advance and pass it to the Remove method, but when Remove is called, I get this message in the immediate window (it does not throw an exception):
Expression has been evaluated and has no value

I don't really know what the problem is or why it won't remove the icons, but I've spent a lot of time hunting down possible solutions, and so far, none have panned out.  Any ideas? 

UPDATE: The only way I was able to remove the icons was via wiping the preferences.


Accepted Solutions
Solution
Accepted by topic author bconner26
‎09-25-2015 03:20 AM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Unable to remove button from Toolbar

Try invalidating ACT. I think I remember the DevCompnent toolbar does not have a 'refresh' when removing or modifying the existing icons.

 

Something like after changing the toolbar:

this.ACTApp.Invalidate();

Or even

toolbar.invalidate();

 

--- Jim Durkin

View solution in original post


All Replies
Solution
Accepted by topic author bconner26
‎09-25-2015 03:20 AM
Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Unable to remove button from Toolbar

Try invalidating ACT. I think I remember the DevCompnent toolbar does not have a 'refresh' when removing or modifying the existing icons.

 

Something like after changing the toolbar:

this.ACTApp.Invalidate();

Or even

toolbar.invalidate();

 

--- Jim Durkin

Copper Contributor
Posts: 42
Country: United States

Re: Unable to remove button from Toolbar

I think that did it.  Thanks, Jim!