Balloon (System Tray) Events


I'd like to send certain events from my app to appear as bubble/balloon tips from the system tray.  I've seen a lot of documentation on this, including a really straightforward example from MS, but although the project compiles the balloons dont appear.  Could anyone give me a really simple example of a balloon notification, on minimize, or on.. any event?

- M

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

heres one in

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
This is probably exactly what you are looking for...

I use this myself, it works great!

All you will need to do is wire the desired events. In my case, I want my window to vanish when minimized and run using the notifier above. To enable that kind of functionality, drag and configure a NotifyIcon into your project, this will be the icon displayed in the systray that represents your application. To make your application vanish when minimized (so that only the notify icon shows) wire this event

private void Form1_Resize(object sender, System.EventArgs e)
      if (this.WindowState == FormWindowState.Minimized)
            // Resized because of a minimize

I tried directly wiring the minimize event and it didn't work as well as connecting into the resize event above.

You can also create a context menu to appear when your icon is right-clicked, which is handy if you want to redisplay your form. Simply create a normal menu in your application, then in the properties of the NotifyIcon, put the menu name in the ContextMenu field. I created a "Show Main Window" menu entry, the click event for which is:

private void cxMenu_ShowMain_Click(object sender, System.EventArgs e)
      if (this.WindowState == FormWindowState.Normal)
            // Already in normal state, bring to front
            this.WindowState = FormWindowState.Normal;

This will either restore the main window to the "front" application if it's already open, or un-minimize it if necessary. The Show() is required if you hid the window on minimize.
nikez2k4Author Commented:
Thanks for the links/comments.  I'm checking them out later today.
dbtoth -- that code you pasted, is this code just to minimise the app to the system tray and hide from the taskbar? I cant see anything in there for Balloon (system tray) tips...

- M
The link at the top of the comment is to a full featured MSN'like pop up... I will whip you up some basic balloon code and post it today.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.