Notifyicon present in system tray twice

Posted on 2006-05-21
Last Modified: 2012-08-13
Hi experts,

I have a WinForms application which runs from a notifyicon in the Windows system tray. The notifyicon's context menu has a couple of menu items which are visible conditional on the user's level in the company. I am using a module to query a database for information on the user, and then to set the menu items' visibility depending on this information. My problem is that when I compile the application, the notifyicon is visible in the system tray twice, and also that when a particular form is launched another instance of the notifyicon appears in the system tray. There is only ever one instance of the application's process running though.

If anyone who can point me towards how to resolve this problem I'd be very grateful,

Question by:louise001
    LVL 28

    Accepted Solution

    You should probably check your code and see where you create the icon. On the second form that creates another one, you should check the properties and make sure you don't have it creating one for itself. Also, a notifyicon can linger after an application crash, you may want to check that.
    LVL 85

    Expert Comment

    by:Mike Tomlinson
    How are you creating the NotifyIcon?

    Is it on the form at design-time or are you creating a dynamic one via code?

    Author Comment

    Thanks for suggestions both of you (IM - it was on the form at design time). strickdd pointed me in the right direction - in some forms I had the line Private myFrmStart as New FrmStart AND I had Public FrmStart declared in my application's module. Doh.

    Thanks again,


    Featured Post

    Training Course: Java/J2EE and SOA

    This course will cover both core and advanced Java concepts like Database connectivity, Threads, Exception Handling, Collections, JSP, Servlets, XMLHandling, and more. You'll also learn various Java frameworks like Hibernate and Spring.

    Join & Write a Comment

    Flash ( has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now