在 C# 中重绘气球提示和工具提示?
我编写了一个 C# 应用程序,它是一个简单的倒计时器。我自己用它来记录烹饪时间(不要忘记煮意大利面)和其他目的。
它在托盘中工作。将鼠标悬停在图标上时,它会以工具提示的形式显示剩余时间。单击后,它会在气球提示中显示剩余时间。我希望显示的时间“滴答作响”,即每秒更新一次。
如何强制更新/重绘气球和工具提示?
编辑:我不需要重新绘制气球本身。我只需要时间去改变。从某种意义上说,我想使气球窗口无效,以便 Windows 读取存储在 BalloonText 属性中的文本并重绘它。
I wrote a C# application that is a simple countdown timer. I use it myself to keep track of cooking time (not to forget about boiling pasta) and other purposes.
It works in the tray. When hovering the icon it shows remaining time as a tooltip. When clicked it shows remaining time in a balloon tip. I would like displayed time to be "ticking down", i.e. to update every second.
How do I force update/redraw of the balloon and tool tip?
EDIT: I don't need to redraw the balloon itself. I only need time to be changing. In some sense I want to invalidate the balloon window, so that Windows will read text stored in BalloonText property and redraw it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
正如您现在可能已经猜到的,工具提示在鼠标悬停时显示,并且其内容是静态的。
您最好的选择可能是使用 Outlook 样式的通知窗口,as如本文所述。您将可以更好地控制显示的内容。
As you may have surmised by now, the tooltip is displayed on mouse-over, and its content is static.
Your best bet might be to use an Outlook-Style notification window, as described in this article. You will have much better control over your displayed content.