VSTO getScreentip只能出现一次

时间:2018-10-15 15:03:57

标签: c# vsto ribbon office-addins

使用VSTO加载项并使用getScreentip回调。我观察到,如果功能区中的2个按钮使用了此回调(即使功能不同),也将不再显示该按钮。我猜它在色带加载过程中会产生错误,但是我不确定如何看到它。控制台中没有任何显示。

<button id="MeetingOptionsDisabled_Cal" label="Meeting"
    image="MeetingDisabledBtn"
    size="large"
    getVisible="GetVisible"
    getScreentip="GetScreentip"
    getSupertip="GetSupertip_Cal"/>
 </group>

 <button id="MeetingOptionsDisabled_Main" label="Meeting"
    image="MeetingDisabledBtn"
    Screentip="MyTip" 
    size="large"
    getVisible="GetVisible" 
    getScreentip="GetScreentip"
    getSupertip="GetSupertip_Main"/>
 </group>

---后面的代码

public string GetSupertip_Cal(Office.IRibbonControl control)
{
  return "Test screen tip";
}
public string GetSupertip_Main(Office.IRibbonControl control)
{
  return "Test screen tip";
}

2 个答案:

答案 0 :(得分:1)

您可以在运行时使用File > Options > Advanced > General > Show add-in user interface errors查看功能区错误。

答案 1 :(得分:0)

感谢@chris,非常有帮助。我发现第二个按钮具有默认的屏幕提示属性。通过启用用户界面错误,我知道属性screentip和getscreentip是互斥的。

相关问题