About the bubble prompt of C # Tray Icon control NotifyIcon

Source: Internet
Author: User

1), Framework1.1. How to display a tray icon prompt with the close button?

I was able to find a simple answer. Instead of using:

TaskbarIcon.ShowBalloonTip(10000); 

I cocould use the second form of this function:

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

This actually adds a close box to the balloon tip!

========================================================== ======================================

2), Framework2.0, improved policyicon.

2.1). How can I disable the bubble prompt of the tray icon without Timeout?

Set policyicon. Visible = false, and the bubble prompt will be immediately closed;

Then set policyicon. Visible = true;

2.2). Why is the timeout set by the ShowBalloonTip function invalid?

Because there is a time-out interval limit: 10 m-30 m, the settings in this range will automatically move closer to the nearest value.

Appendix:

Policyicon is. NETs version of the system tray icon, those little icons that appear next to the clock in the Windows Start bar .. NET 2.0 added the ability to display a pop-up balloon tip pointing at a tray icon. however, this capability doesnt always work as you wowould perform CT.

 

He policyicon. ShowBalloonTip method has the following signature:

  • ShowBalloonTip (Int32)-Displays a balloon tip in the system tray for the specified time period (in milliseconds ).
  • ShowBalloonTip (Int32, String, String, ToolTipIcon)-Displays a balloon tip with the specified title, text, and icon in the system tray for the specified time period.

 

 

Issue #1: Timeout Limits

The specified yicons balloon tip will appear for a minimum of 10 seconds and maximum of 30 seconds, though this can vary by operating system. timeout values that are too small or too large will be forced into this range.

Issue #2: Requires User Activity

If the user is not using the computer (no keyboard or mouse events are occurring) then the system does not count this time towards the timeout, and the balloon tip cocould appear indefinitely. the logic is that users shocould not miss communications when they are away from their computer.

Issue #3: One Balloon at a Time

Only one balloon tip can appear on the system tray at one time. if an application attempts to display a second balloon tip, the first balloon is closed immediately (regardless of the timeout setting) and the second balloon appears. however, if the first balloon was displayed by another application, it wont close until its timeout expires, at which point the second balloon will appear.

Issue #4: Balloon Never Closes

If an application exits without explicitly setting the policyicon. visibleproperty to false, the icon remains in the system tray (though it disappears when the user moves the mouse over the icon ). and if a balloon tip was showing for that icon, the balloon will remain visible even after the application has exited.

Tip: To Close Balloons

To explicitly close a balloon at any time, simply set theNotifyIcon. Visible property to false, then immediately back to true.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.