Scott Hanselman

Vote on this Whidbey Bug: How to create a Tray Icon (NotifyIcon) with WinForms 2.0

January 16, 2005 Comment on this post [9] Posted in Programming
Sponsored By

Whatisplaying1

While Tray Icons (and applications that use ONLY TrayIcons as their UI) are a major part of our lives, there's limited support in WinForms (2.0) for them without resorting to P/Invoke and vestigial MainForms who only call this.Hide().

NotifyIcon should be extended to support BalloonHelp. Hans Blomme's now-famous extended version of NotifyIcon is the canonical example. It still works under 2.0, but the 2.0 addition of the ContextMenuStrip makes it a little tricky. His free stuff could be integrated into the 2.0 NotifyIcon easily, adding a powerful (and missing) feature to 2.0 WinForms. Additionally, there should be a way for a Form to startup hidden to avoid the flash of the form before it calls this.Hide(), deferring to it's NotifyIcon.

Help us all out and vote to get this omission fixed in Whidbey.

UPDATE: Some Reflectoring has confirmed that has in fact been fixed in the December CTP! All is as it should be. Thanks to Chris Sells and Scott Swigart.

Now playing: Kanye West, Twista & Jamie Foxx - Slow Jamz

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
January 16, 2005 10:24
OK, done. I noticed the following, though, on your bug report:

OS Language: Dutch

??
January 16, 2005 23:48
> While Tray Icons (and applications that use ONLY TrayIcons as their UI) are a major part of our lives

I've told you a million times to stop exaggerating.
January 17, 2005 3:12
So how is Raymond Chen's campaign to educate the world about the fact that THEY'RE NOT CALLED TRAY ICONS going, do you think?

:-)
January 17, 2005 13:18
Maybe its just too late and I'm not thinking/reading clearly (in which case I may be completely off here), but just FYI, you don't actually have to have a form run on startup in a WinForms app.
January 17, 2005 20:13
Interesting point, but what would start the message pump, then?
January 18, 2005 2:42
I'm been having some internal conversations w/ the Windows Forms team that indicate that this feature was added to Windows Forms in either the November or December CTP of Whidbey. Apparently, there's a ShowBalloonTip method on the NotifyIcon class. Can anyone confirm?
January 18, 2005 5:18
I wish I could remember the right blog (I would then point you to it) but I read recently that the pump will get started anyway, you don't need to open a form. I'm positive this came from a Microsoftie...
January 18, 2005 6:55
Here, I dug it up, courtesy of IanG: http://www.interact-sw.co.uk/iangblog/2004/11/30/nomainform.
January 19, 2005 11:37
My correct email below...

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.