title: Why does modal-form disappear completely when minimized?
body: <p>I'm trying to have the owner-form minimize when the modal-form is minimized. But when I minimize the modal-form – it disappears completely. (- I can click on the owner-form.)</p>
  
  <p>How do I solve this?</p>
  
  <p>I have:</p>
  
  <pre><code>public partial class Form1 : Form
  {
      Form2 frm2 = new Form2();
  
      public Form1()
      {
          InitializeComponent();
          frm2.Owner = this;
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          frm2.ShowDialog();
      }
  }
  </code></pre>
  
  <p>And:</p>
  
  <pre><code>class Form2 : Form
  {
      Form1 frm1;
      FormWindowState ws = new FormWindowState();
  
      public Form2()
      {
          SizeChanged += new EventHandler(Form2_SizeChanged);
      }
  
      void Form2_SizeChanged(object sender, EventArgs e)
      {
          frm1 = (Form1)Owner;
          if (WindowState == FormWindowState.Minimized) 
          { 
              ws = frm1.WindowState; 
              frm1.WindowState = FormWindowState.Minimized; 
          }
          else frm1.WindowState = ws;
      }
  
  }
  </code></pre>
  
  <p>(While trying this, I also ran into this: <a href="https://stackoverflow.com/questions/8704921/modal-form-doesnt-appear-in-tray-until-minimized-and-owner-form-is-clicked-once">Modal form doesn&#39;t appear in tray until minimized and owner-form is clicked once. How do I make it appear?</a> )</p>