|
你好 jiulongpo老师 看了您发的关于getvisible回调的内容 本人初学了一下 遇到些问题 还望您能答疑,感激不尽 - Sub rxIRibbonUI_onLoad(ribbon As IRibbonUI)
- Set rxIRibbonUI = ribbon
- bBox1_Visible = True
- End Sub
- Sub IsVisible(control As IRibbonControl, ByRef returnedVal)
- returnedVal = bBox1_Visible
- End Sub
- Sub Shared_pressed(control As IRibbonControl, ByRef returnedVal)
- returnedVal = bBox1_Visible
- End Sub
- Sub Toggle_Show_Hide(control As IRibbonControl, pressed As Boolean)
- bBox1_Visible = pressed
- rxIRibbonUI.Invalidate
- End Sub
复制代码 xml代码如下- <?xml version="1.0"?>
- <customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui">
- <ribbon startFromScratch="false">
- <tabs>
- <tab id="mytab1" label="3513" insertAfterMso="tabHelp">
- <group id="group7" label="快捷操作">
- <button id="button7-1" label="机台号" imageMso="TextEffectTransformGallery" onAction="Generate_Machine" size="large" getVisible="IsVisible" />
- </group>
- <group id="group8" label="Help">
- <button id="button8-1" label="显示/隐藏" onAction="Toggle_Show_Hide" getPressed="Shared_pressed" size="large" />
- </group>
- </tab>
- </tabs>
- </ribbon>
- </customUI>
复制代码 问题1.如果xml代码内加上getPressed="Shared_pressed" 这么一句 那么加载项就不会显示 去掉即可显示 问题2.去掉getPressed="Shared_pressed" 之后 运行button8-1 就不会达到预期效果 显示与隐藏 还望您能抽空帮忙看下 ,再次感激 |
|