如何使功能区在不同的工作簿中启用不同的按钮?
该加载项中只有一个功能区对象,因此它在所有工作簿之间共享。如何在不同的工作簿中启用不同的功能区按钮?
There is only one ribbon object in the add-in, so it's shared between all workbooks. How I can make different ribbon buttons enabled in different workbooks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您正在谈论功能区 XML,因为设计者试图使功能区看起来更基于文档。
如果您像我怀疑的那样使用 Ribbon XML,那么这非常困难,我建议两个选择。切换到功能区设计器,您可以在其中处理 Loaded 和其他事件,并在按钮控件上设置 .Enabled 属性。或者尝试 http://vstocontrib.codeplex.com/,它旨在使这种情况变得更容易。阅读有关丝带工厂的 doco。
I assume you are talking about Ribbon XML as the designer tries to make it seem like the ribbon is more based on the document.
If you are using Ribbon XML as I suspect, then this is very difficult and I would suggest two options. Either switch to the Ribbon Designer, which you can handle the Loaded and other events and set the .Enabled property on the button controls. Or give http://vstocontrib.codeplex.com/ a go, it is designed to make this scenario much easier. Have a read of the doco around the Ribbon Factory.