功能区labelControl GetSuperTip不起作用

时间:2014-07-28 17:46:24

标签: c# excel ms-office vsto ribbon

根据msdn documentationlabelControl支持getSupertip属性,用于在功能区控件上设置工具提示。

出于某种原因,工具提示不起作用。相同的实现适用于其他控件(如button),但不适用于labelControl。此外,getLabel等其他回调适用于标签,而不是getSupertip

知道什么是错的吗?

功能区XML

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
  <ribbon>
    <tabs>
      <tab id="custom" label="Custom AddIn">
        <group id="ConfigGroup" label="Configuration">
          <labelControl id="lb1" getLabel="GetLabel" getSupertip="GetSupertip" />
          <button id="bt1" label="Set Server URL" getSupertip="GetSupertip" />
          ...
        </group>
      </tab>
    </tabs>
  </ribbon>
</customUI>

功能区代码

public class CustomRibbon : ExcelRibbon, IExcelAddIn
{
    public string GetSupertip(IRibbonControl control)
    {
        switch (control.Id)
        {
            case "lb1":
                return "The current server address is: " + API.serverURL;
            case "bt1":
                return "Click to change the server URL. (Currently: " + 
                       API.serverURL + ")";
        }
    }

getLabel仅针对labelControl工作的getSupertipbutton的图片。 labelControl label working and tooltip working on button

1 个答案:

答案 0 :(得分:1)

看起来这是微软的错误。文档错误地将 getSupertip 列为属性,或属性存在,但实现不使用它。无论哪种方式,都无法在labelControl上获得Supertip或其他工具提示文字。

这是我在MSDN论坛上收到的回复:ribbon-labelcontrol-getsupertip-doesnt-work