title: How to prevent a Windows Form from being sent to the back or how to keep it on a specific z-order
body: <p>I'm encountering a strange problem with Form layout ordering (z-order). Lets say I've three Windows Forms; Form1, Form2 and Form3.</p>
  
  <p>Form1 is launched as application's main form, and it has a button that opens Form2 as a Dialog (using <code>ShowDialog()</code>). Form2 also has button that opens Form3 (but not as a Dialog, using <code>Show()</code>). 
  Once Form3 is opened, it jumps to the background (behind Form1) as soon as Form2 is clicked. I want to keep Form3 at-least above Form1 when Form2 is clicked, since it contains some options that assist working on Form2.</p>
  
  <p>I Don't want to use <code>Form3.TopMost = True;</code> since it then keeps the Form3 on top of nearly everything even if you open or switch to any other application (e.g. Windows Explorer, Internet Browsers etc).</p>
  
  <p><code>.BringToFront()</code> also doesn't help. I've tried several combinations of some relevant Form events with <code>Form.BringToFront()</code>, <code>Form.Activate()</code> etc but all in vain. Any help would be appreciated.</p>
  
  <p>Here is the code for reference:</p>
  
  <p>Form1:</p>
  
  <pre><code>Form2 obj2 = new Form2();
  private void button1_Click(object sender, EventArgs e)
  {
      if (obj2 != null &amp;&amp; obj2.Visible) { obj2.Focus(); return; }
  
      obj2 = new Form2();
      obj2.ShowDialog();
  }
  </code></pre>
  
  <p>Form2:</p>
  
  <pre><code>Form3 obj3 = new Form3();
  private void button1_Click(object sender, EventArgs e)
  {
      if (obj3 != null &amp;&amp; obj3.Visible) { obj3.Focus(); return; }
  
      obj3 = new Form3();
      obj3.Show();            
  }
  </code></pre>