将自定义功能区与自定义表单区域关联 - Outlook 2007,C#
有什么方法可以将自定义功能区(我在 VS 设计器中创建的自定义选项卡和按钮)与自定义表单区域关联起来吗?
我知道我可以使用功能区扩展现有窗口(例如撰写消息、联系人...),但如何创建一个新选项卡,其中自定义功能区位于顶部,自定义表单区域位于底部。我必须创建自定义消息类吗?
谢谢。
Is there any way how can I associate custom ribbon (custom tabs and buttons I created in VS designer) with a custom form region?
I know that I can extend the existing windows with my ribbon (such as Compose message, Contacts...), but how can I create a new tab with custom ribbons at the top and custom form region at the bottom. Do I have to create a custom message class?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须创建一个自定义消息类。基本上,功能区和表单是两个独立的机制。
不过,如果这对您很重要,您可以尝试的是在激活表单区域时使功能区无效,然后根据您的需要以编程方式更新功能区(在 msdn 上动态更新功能区)。
如果您的意思相反(激活功能区选项卡时显示某个表单区域),那么您就无法拥有它:正在更改的功能区选项卡没有事件/回调。
You have to create a custom message class. Basically the ribbon and the form are two seperate mechanisms.
What you could try though, if its important for you, is invalidating the ribbon on activation of your form region and then programmatically update the ribbon according to your needs (dynamic updating of the ribbon at msdn).
If you mean it the other way around (showing a certain form region when your ribbon tab is activated) then you can't have it: there are no events/callbacks for the ribbon tabs being changed.
我一直在努力解决这个问题,正如 Georg 所说,两者是完全独立的,并且行为也非常不同,因此使它们保持一致以使它们看起来像是相关的是相当困难的。
您可以在 http://vstocontrib.codeplex.com/SourceControl/changeset/view/b35f26fdca15#src%2fDemos%2fTwitterFeedCore%2fTwitterFeed%2fContactFeed.cs
它依赖于我的 VSTO contrib 项目,但它应该允许您轻松实现你想要的。
I have been trying to solve this issue and as Georg said the two are quite separate and behave very differently, so bringing them into line to make them appear like they are related is quite difficult.
You can have a look at my example twitter app at http://vstocontrib.codeplex.com/SourceControl/changeset/view/b35f26fdca15#src%2fDemos%2fTwitterFeedCore%2fTwitterFeed%2fContactFeed.cs
It relies on my VSTO contrib project, but it should allow you to easily achieve what you want.