I have a .net windows forms application that needs to open directly to the notify icon (system tray) with no visible windows. I realize that I can do this in the onshown event or something like it. But if I do that I get a flash of the window. How can I avoid that flash? I have tried modifying my Program.cs
file to look like this:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm frm = new MainForm();
frm.Visible = false;
Application.Run(frm);
However this doesn't work either because Application.Run()
makes the form visible. I am pretty sure there is an easy answer that I am missing. Any help is greatly appreciated.