.Net ramblings
# Monday, 12 July 2004
System tray icons in Windows forms apps

If you add a NotifyIcon (system tray icon) to a Windows forms application, you will need to modify the dispose event of the form containing the icon, to explicitly call dispose on the notifyIcon as follows:

protected override void Dispose( bool disposing )
 if( disposing )
  if (components != null)
 base.Dispose( disposing );

if you don't do this, the icon will get left in the system tray after the application quits, until you move the mouse over the icon and then it will disappear.

Monday, 12 July 2004 10:02:42 (GMT Daylight Time, UTC+01:00)  #    Comments [0]  .Net Windows Forms

Please login with either your OpenID above, or your details below.
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview