How do I create a windowless C# app that resides in the tray?

2.5k Views Asked by At

As question says, How do I create such an app ? How do I make it windowless and make it reside in the system tray (bottom right) ?

2

There are 2 best solutions below

0
On BEST ANSWER

If you want it to start minimized, just do a WindowState = FormWindowState.Minimized before showing the window, and remove the code in NotifyIcon.DoubleClick that maximizes it.

0
On
static class Program
{
    [STAThread]
    static void Main()
    {
        NotifyIcon icon = new NotifyIcon();
        icon.Icon = System.Drawing.SystemIcons.Application;
        icon.Click += delegate { MessageBox.Show("Bye!"); icon.Visible = false; Application.Exit(); };
        icon.Visible = true;
        Application.Run();
    }
}