CommandBar events stop arriving

A

Amitai

I have my own CommandBar and the button in it is firing events on the first
few runs, but then it stops responding.
After I shutdown the machine it works again.
I am using a usual event handling in .NET:
btn1.Tag = "myBeautifulTag1";

btn1.Click+=new _CommandBarButtonEvents_ClickEventHandler(OnBtn1Click);

This is one of the most strangest things!

I also can not find a way to disable old Add-ins. There are not in the list
of add-ins.
Can anyone shed the light?
Thanks
Amitai
 
A

Amitai

Solved... (this time I hope it's final)
The added CommandBar, as well as the CommandBarButton and event handler
should be defined at the class level, rather than function level.
If not declared at the class level, the garbage collector deletes these guys
after a while and the button stops responding to clicks.
Regarding disabling addins:
I built the setup project, then run install and uninstall. It looks OK now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top