根据msdn documentation,labelControl
支持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
工作的getSupertip
和button
的图片。
答案 0 :(得分:1)
看起来这是微软的错误。文档错误地将 getSupertip
列为属性,或属性存在,但实现不使用它。无论哪种方式,都无法在labelControl
上获得Supertip或其他工具提示文字。
这是我在MSDN论坛上收到的回复:ribbon-labelcontrol-getsupertip-doesnt-work