<p>What is the proper way to minimize a WinForms app to the system tray? </p>

<p>Note: minimize to <strong><em>system tray</em></strong>; on the right side of the taskbar by the clock. I'm not asking about minimizing to taskbar, which is what happens when you hit the "minus" button on the window.</p>

<p>I've seen hackish solutions like, "minimize, set ShowInTaskbar = false, then show your NotifyIcon."</p>

<p>Solutions like that are hackish because the app doesn't appear to minimize to the tray like other apps, the code has to detect when to set ShowInTaskbar = true, among other issues.</p>

<p>What's the proper way to do this?</p>

```
```
this.WindowState = FormWindowState.Minimized
```
```
That is the built in way to do it and it looks fine to me most of the time. The only time is has some weirdness to it is if you call it on startup which has some weirdness sometimes which is why most people will also set the ShowInTaskbar = false and hide the form too.
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.windowstate.aspx