NotifyIcon and Always Hide setting

Yesterday, I had another one of those moments with the NotifyIcon class in C#.

During testing, if the icon was set to always hide under Windows XP then it would simply never display in the task bar.  This I thought was very strange as it should be in the systray, just not visible when its in the compact state.

The reason? Well on a balloon close event I would also remove the icon from the systray as it had served its purpose. However, when an icon is set to Always Hide, when a balloon tip is shown it is instantly closed (by XP Shell) which causes the balloon close event to be raised which in turn removes the icon from the systray. 

I should have realised sooner but simply didn’t link the two actions. Next time in situations like this, always check events which hook up to the close event.

Technorati Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *