单击时区按钮没有触发事件通过的OnAction设置 [英] Ribbon button not firing event set by onAction when clicked

查看:180
本文介绍了单击时区按钮没有触发事件通过的OnAction设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我设计一个加载到Outlook 2010在这里我想火(或者更确切地说,捕捉)单击一个按钮时触发的事件如图所示的 .microsoft.com /论坛/ EN-US / VSTO /线程/ a3fa9ea5-6710-48c4-adb7-1f11afe34f81 />。我已经指定了适当的XML(因为更改它被认为在功能区)。不过,我想抓住这次活动是不是没有在所有解雇或(更可能)发射比我听了期待(听吗?)的其他方式。

I've designed an add-in to Outlook 2010 where I'm trying to fire (or, rather, catch) an event fired when a button is clicked as shown in this article. I've targeted the right XML (since the changes to it are seen on the ribbon). However, The event I'm trying to catch is either not fired at all or (more likely) fired an other way than what my listened is looking (listening?).

我也试图通过MSDN上参考这里。 这里,大多的此处。无果,虽然...我不知道它有与重新利用信息的事情。

I also tried to go by the reference on MSDN here, here and mostly here. To no avail, though... I wonder if it's got to do with the "repurpose" information.

下面的标记。

<tab idMso="TabMail">
  <group id="group1" label="CRMK">
    <button 
      id="MyId"
      onAction="Button_Click"
      label="Do me!"
      size="large" />
  </group>
  <group id="group2" label="group2">
    <button id="button1" label="button1" showImage="false" />
  </group>
</tab>

和后面的代码看起来是这样的。

And the code behind looks like this.

private void Button_Click(Object sender, RibbonControlEventArgs eventArgs)
{
  MessageBox.Show("Button clicked...");
}



我在想什么?如何调试这样的事情?

What am I missing? How can I debug such a thing?

推荐答案

这是因为你的签名。这是错误的带状物体。它应该是如下:

This is because of your signature. It's wrong for ribbon objects. It should be as follows.

public void Button_Click(Office.IRibbonControl control){ ... }

这篇关于单击时区按钮没有触发事件通过的OnAction设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆