excel - customtab 和 contextcellmenu :按钮激活/取消激活
问题描述
我有一个 Excel Web 插件可以正常工作:
一个包含五个控制按钮的自定义选项卡 一个菜单控件添加到 contextmenucell..
然而,激活和停用按钮仍然存在一些困难。
'<'Enabled'>false<'/Enabled'>' XML 指令引发«无效子元素»消息
解决方案
您需要将<Enabled>
标签粘贴到控件元素中:
<Control xsi:type="Button" id="residLabel6" >
<Label resid="residLabel6" />
<Supertip>
<Title resid="residLabel6" />
<Description resid="Contoso.TaskpaneButton.Réinit" />
</Supertip>
<Icon>
<bt:Image size="16" resid="Contoso.Réinit_16x16" />
<bt:Image size="20" resid="Contoso.Réinit_20x20" />
<bt:Image size="24" resid="Contoso.Réinit_24x24" />
<bt:Image size="32" resid="Contoso.Réinit_32x32" />
<bt:Image size="40" resid="Contoso.Réinit_40x40" />
<bt:Image size="80" resid="Contoso.Réinit_80x80" />
</Icon>
<Action xsi:type="ExecuteFunction">
<FunctionName>action3</FunctionName>
</Action>
<Enabled>false</Enabled>
</Control>
默认情况下,Office 应用程序启动时会启用任何加载项命令。如果您希望在 Office 应用程序启动时禁用自定义按钮或菜单项,请在清单中指定。只需在控件声明中的元素下方(而不是内部)添加一个Enabled
元素(带有 value )。false
Action
在启用和禁用加载项命令一文中了解更多信息。
推荐阅读
- vba - 硒whatsapp按钮搜索vba
- javascript - 使用 Socket.io 有效发送大坐标数组
- python - 比较 2 个字符串列表,更新相同索引位置的第 3 个字符串列表
- c# - 进程在 Ubuntu 上不工作,但在 Windows 上工作
- java - JUnit @Rule 和 ExpectedException.none() 线程安全吗?
- javascript - 用于 Rocket Chat iframe 身份验证的 NodeJS 应用程序抛出 SyntaxError: Unexpected token (
- html - My css and html code is acting very strange
- unity3d - Unity Genrics 动画控制器
- ajax - Laravel 5.6:为什么 AJAX POST 到控制器不显示控制器中的数据加载?
- python - How to translate this Curl command into a Pycurl call?