如何重新绘制 Word 2003 菜单栏

发布于 2024-07-04 20:31:23 字数 396 浏览 4 评论 0原文

我有一个 Word 2003 .dot 模板,可以根据活动文档的情况更改其菜单。
Word.ApplicationDocumentChangeDocumentOpenNewDocument 事件触发设置 .Visible.Enabled 属性。

切换活动文档时,通过更改 Visible 属性公开的控件会正确显示,但已启用/禁用的文本按钮不会更改外观。 您可以通过将鼠标悬停在启用的控件上来显示它们,但禁用的控件不会重新绘制,直到您在前面放置一个窗口。

有没有一种简单的方法可以向菜单栏发送重绘消息,以模拟隐藏和暴露?

I have a Word 2003 .dot template that changes its menu based on the condition of the active document.
The DocumentChange, DocumentOpen and NewDocument events of Word.Application trigger setting the .Visible and .Enabled properties of CommandBarButton controls.

On switching active documents, controls exposed by changing the Visible property display correctly, but text buttons which have been enabled/disabled do not change appearance. You can show enabled controls by hovering over them, but the disabled ones do not repaint until you place a window in front.

Is there a simple way to send a repaint message to the menubar, to simulate hiding and exposing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

仙气飘飘 2024-07-11 20:31:23

你正在玩弄可见的东西。 控件的启用属性。 但是您是否尝试隐藏/取消隐藏整个命令栏来刷新它?

application.CommandBars.ActiveMenuBar.visible = false
application.CommandBars.ActiveMenuBar.visible = true

You are playing with the visible & enabled properties of the controls. But did you try to hide/unhide the whole commandbar to refresh it?

application.CommandBars.ActiveMenuBar.visible = false
application.CommandBars.ActiveMenuBar.visible = true
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文