简体   繁体   English

带关闭按钮的气球工具提示 - C#

[英]Balloon tooltip with close button - C#

How do I create a ballon tool tip with a close button. 如何使用关闭按钮创建气球工具提示。

I can show a tooltip: 我可以展示一个工具提示:

TaskbarIcon.ShowBalloonTip(10000);

but I can't do the opposite: 但我做不到相反的事情:

TaskbarIcon.CloseBalloonTip();

Or even a way to show a close box on a Balloon Tip. 甚至可以在气球提示上显示关闭框。

I saw this question posted on another site but with no (free) answer. 我看到这个问题发布在另一个网站上,但没有(免费)答案。

Thanks in advance 提前致谢

I was able to find a simple answer. 我找到了一个简单的答案。 Instead of using: 而不是使用:

TaskbarIcon.ShowBalloonTip(10000); 

I could use the second form of this function: 我可以使用这个函数的第二种形式:

TaskbarIcon.ShowBalloonTip(10000,"Title","Message",ToolTipIcon.None); 

This actually adds a close box to the balloon tip! 这实际上为气球提示添加了一个关闭框!

You might find this interesting: 你可能会发现这很有趣:

http://www.tooltips.net/ http://www.tooltips.net/

This question has a helpful answer on closing the balloon. 这个问题对于关闭气球有一个有用的答案。

Unless you need to hook an event on close, you don't need a button on the balloon, and even if you do, you can hook the balloon's click event to accomplish the same thing. 除非您需要在关闭时挂钩事件,否则您不需要气球上的按钮,即使您这样做,也可以挂钩气球的点击事件来完成同样的事情。

There are flags that allow you to do things like put an X in the upper right hand corner of the balloon so that the user can dismiss it. 有一些标志可以让你做一些事情,比如在气球的右上角放一个X,以便用户可以将其解雇。 See here for more info: 有关详情,请参阅此处:

http://msdn.microsoft.com/en-us/magazine/cc188923.aspx http://msdn.microsoft.com/en-us/magazine/cc188923.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM