[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Notifyicon present in system tray twice

Posted on 2006-05-21
3
Medium Priority
?
725 Views
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,

Louise
0
Comment
Question by:louise001
3 Comments
 
LVL 28

Accepted Solution

by:
strickdd earned 750 total points
ID: 16734065
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.
0
 
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 16734073
How are you creating the NotifyIcon?

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

Author Comment

by:louise001
ID: 16776855
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,

Louise
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses
Course of the Month19 days, 22 hours left to enroll

872 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