在窗口处于非活动状态时刷新 Office 功能区 UI [英] Refresh the Office Ribbon UI while the window is inactive

查看:63
本文介绍了在窗口处于非活动状态时刷新 Office 功能区 UI的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理一个 Office 功能区项目.(幻灯片)

I am working on a Office Ribbon project. (PowerPoint)

它上的标签正在从计时器定期更新.(它显示我们服务器的当前连接数)

A label on it is being periodically updated from a timer. (It is displaying the current number of connections to our server)

当 PowerPoint 窗口处于焦点时,标签会正确更新.但是,当窗口处于非活动状态时,更新会暂停.(它们仅在 PowerPoint 窗口获得焦点后出现)

When the PowerPoint window is in focus, the label is updated correctly. However, when the window is inactive, the updates are suspended. (they appear only after the PowerPoint window receives focus)

这是多显示器设置的问题,或者当将 PowerPoint 对齐到屏幕的一半时 - 我们需要显示正确的数据.

This is an issue for multi-monitor setups, or when snapping PowerPoint to a half of the screen - we need correct data to be displayed.

我知道这背后的想法是降低 CPU 负载,但我想覆盖该行为.

I understand that the idea behind this is to lower the CPU load, but I would like to override the behavior.

我尝试了 Invalidate、PerformLayout 和类似的方法,但无法刷新功能区.有没有办法做到这一点?

I tried the Invalidate, PerformLayout and similar methods, but can't get the ribbon to refresh. Is there any way to do this?

推荐答案

不.无法在所有窗口中更新 Fluent UI.当窗口变为活动状态时调用回调.

Nope. There is no way to update the Fluent UI in all windows. The callbacks are invoked when the window becomes active.

您可以考虑为此类需求创建自定义任务窗格.在这种情况下,您将能够分别控制每个实例并在运行时更新 UI.您可能会发现以下文章很有帮助:

You may consider creating Custom Task Panes for such needs. In that case you will be able to control each instance separately and update the UI at runtime. You may find the following articles helpful:

这篇关于在窗口处于非活动状态时刷新 Office 功能区 UI的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆