Search code examples
c#.netwinformsc#-4.0systray

How do I not have a Window displayed on launch?


Possible Duplicate:
How to make the startup form initially invisible or hidden

My application has a System Tray and I don't want the Window appearing on launch.

How can I accomplish this?


This is a default Windows Form application.

I dragged over a notifyIcon and a contexualMenuStrip

When the Form is closed, the application quits (don't want that either). But when the application is launched, the Windows Form is also made visible. So how do I not launch the form on start up (and not quit on closing the window)?


Solution

  • Basically you need to overwrite SetVisibleCore() to achieve that... another option is to set ShowInTaskbar to false and use ApplicationContext in Application.Run.

    Some reference links and sample code: