Windows Develop Bookmark and Share   
 index > Windows Forms General > Any situations where the NotifyIcon.ShowBalloonTip(...) WONT actually show the balloon?
 

Any situations where the NotifyIcon.ShowBalloonTip(...) WONT actually show the balloon?

Hi guys. I have a small puzzle here:

 

I've made a single instance app in C# 2.0 through use of the Microsoft.VisualBasic dll to set up the remoting etc and it works fine. The logic is upon re-running the app, the existing instance fades into view using the AnimateWindow API and assumes an Always-On-Top role through Form1.TopMost = true;

The form also uses clipped regions to give an impression of irregular shape.

To tell the user that it is faster to double click the tray icon, I thought of putting a balloon tip in there but then I hit a problem.

 

I can hear the "sshha-pop!" sound the balloon tip makes as it comes into existence, but I cannot see it on screen! Does anyone know where it is/how to look for it?

Thinking the problem might be with region clipping or AnimateWindow, i disabled these features but the ballon still does not show. I have ensured that it is the existing, running app that is showing the ballon and not the second instance that is quiiting.

Under what circumstances does the ballon make the pop sound, but not actually show?

cjard  Monday, November 27, 2006 12:25 PM
Make sure you are referencing the existing, visible instance of the NotifyIcon object and not accidentally create a new instance that isn't visible...
nobugz  Monday, November 27, 2006 12:43 PM

ref the line in my original post:

I have ensured that it is the existing, running app that is showing the ballon and not the second instancethat is quiiting.

The way I do this is:

Start the app in debug mode in VS IDE

Put a breakpoint on the Event-Fired-When-Second-Instance-Is-Started

Go to the Debug folder in Explorer and start the exe again

The IDE breaks atthat point

This is how I ensured I was popping the NI from the correct app. Please tell me if this method is incorrect (and if it is, howcome thedebugger attached to the second process when it was already attached to the first?)

cjard  Monday, November 27, 2006 2:48 PM

I've just had a similar problem where I was creating a notifyIcon correctly and using the ShowBalloon method but it was not appearing. Balloon tips are not disabled in the registry or group policy.

I fixed it by setting the Icon property (not the BalloonTipIcon). For some reason without the icon being set, it does not display (at least on my machine (XP).

This is the working code:

notifyIcon1.Icon = new System.Drawing.Icon(@"c:\App.ico");
notifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
notifyIcon1.Visible = true;
notifyIcon1.Text = "This is a test";
notifyIcon1.BalloonTipTitle = "Test balloon tip!";
notifyIcon1.BalloonTipText = "This balloon did not work without the Icon property being set";
notifyIcon1.ShowBalloonTip(5000);

Hope this helps.

Chris B_124  Friday, February 29, 2008 5:19 PM

You can use google to search for other answers

Custom Search

More Threads

• Modal Form
• how to add more panels in splitContainer
• possible/how to identify when WebBrowser scrollbars are disabled?
• MDI app - can the assemblies in my solution access MDI's objects?
• To sort filenames according to their extension
• Windows form controls Using in webforms
• Form controls reorder on show
• Howto: Mouse Coordinates
• Setting TreeNodeText Property is too slow
• Need MultiColumn ComboBox in C# Windows