Click here to Skip to main content
15,881,812 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have some problem when impliment Tray icon for windows application.I implimented tray icon application by using notifyicon and context menu but i wouldnt implimented any code in windows form.all the code work in .cs file just only used windows form for only notification and tray icon. Actual problem is that when i closed my application by using task manager click on end process then exe is exit but tray icon is visible and when mouse move on that icon then icon is hidden or invisible.So i want to know how do you remove tray icon when application exit by task bar
so please give me solution as soon as possible.

What I have tried:

.I impliment Application.ApplicationExit event handler also but its not working.
Posted
Updated 24-Feb-16 23:05pm

1 solution

You can set visible to false for the notify icon in your form closing event handler.
 
Share this answer
 
Comments
Member 8089110 25-Feb-16 5:07am    
I am not impliment closing event handler in this application.I am directly closed application by using task bar.Its just like console application.
dan!sh 25-Feb-16 5:09am    
You need to handle the FormClosing event. It will be called as long as application is closed gracefully.
Member 8089110 25-Feb-16 5:48am    
Its not working.I implimented code in c# console application.I used both event handler
exit application and also closing events
dan!sh 25-Feb-16 5:52am    
In your question you state this is a windows form application. Here you are talking about console. Can we settle this first?
Member 8089110 25-Feb-16 6:15am    
Yes sir,it is windows form based application but i havent used exit event handler or closed handler event.I am directly closed application by using task bar end process like we do in console application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900