Answer the question
In order to leave comments, you need to log in
How to bypass duplicate tray icon in C#?
Good evening. Faced such problem:
There are two forms:
1. Form1. Attached to it are trayIcon and trayIconMenu
2. Form2. The form from which I need to reach the trayIconMenu and change the text in one of the menu items (menuItem1).
I do the following in Form2:
Form f2 = new Form1();
As a result, I get two icons in the tray. Why is this happening - I understand. When Form1 is created, a trayIcon attached to it is automatically generated. How can this be bypassed?
Thanks
Answer the question
In order to leave comments, you need to log in
@aush Thanks for the help. I did it like this:
Program.cs:
public static Form1 MainForm1;
....
MainForm1 = new Form1();
Application.Run(MainForm1);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question