title: Minimizing Form to Notification area
body: <p>I have been having issues trying to get my form to minimize into the notification area. </p>
  
  <p>The following code continues to run but my form disappears from the task bar and will not show up.</p>
  
  <pre><code>protected override void OnResize(EventArgs e)
  {
  
      base.OnResize(e);
      bool cursorNotInBar = Screen.GetWorkingArea(this).Contains(Cursor.Position);
      if(this.WindowState == FormWindowState.Minimized &amp;&amp; cursorNotInBar)
      {
          this.ShowInTaskbar = false;
          notifyIcon1.Visible = true;
          this.Hide();
      }
  </code></pre>
  
  <p>How can I go about fixing this?</p>