简体   繁体   中英

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/

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. See here for more info:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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