title: TopMost does not work when used on Forms running in consecutively in different threads and closed by user code
body: <p>I have following sample code</p>
  
  <pre><code>   [STAThread]
      static void Main(string[] args)
      {
          Thread thread = new Thread(() =&gt;
          {
              using (var mww = new Form1())
              {
                  Application.Run(mww);
              }
          });
          thread.Start();
          thread.Join();
  
          thread = new Thread(() =&gt;
          {
              using (var mww = new Form1())
              {
                  Application.Run(mww);
              }
          });
          thread.Start();
          thread.Join();
  
          thread = new Thread(() =&gt;
          {
              using (var mww = new Form1())
              {
                  Application.Run(mww);
              }
          });
          thread.Start();
          thread.Join();
      }
  </code></pre>
  
  <p>Which shows Form1 defined as:</p>
  
  <pre><code>public partial class Form1 : Form
  {
      private readonly Timer _myTimer = new Timer();
  
      public Form1()
      {
          InitializeComponent();
          _myTimer.Interval = 10000;
          _myTimer.Tick += TOnTick;
          TopMost = true;
      }
  
      private void TOnTick(object sender, EventArgs eventArgs)
      {
          _myTimer.Stop();
          Close();
      }
  
      private void Form1_Load(object sender, EventArgs e)
      {
          _myTimer.Start();
      }
  }
  
  partial class Form1
  {
      /// &lt;summary&gt;
      /// Required designer variable.
      /// &lt;/summary&gt;
      private System.ComponentModel.IContainer components = null;
  
      /// &lt;summary&gt;
      /// Clean up any resources being used.
      /// &lt;/summary&gt;
      /// &lt;param name="disposing"&gt;true if managed resources should be disposed; otherwise, false.&lt;/param&gt;
      protected override void Dispose(bool disposing)
      {
          if (_myTimer != null)
          {
              _myTimer.Dispose();
              _myTimer = null;
          }
          if (disposing &amp;&amp; (components != null))
          {
              components.Dispose();
          }
          base.Dispose(disposing);
      }
  
      #region Windows Form Designer generated code
  
      /// &lt;summary&gt;
      /// Required method for Designer support - do not modify
      /// the contents of this method with the code editor.
      /// &lt;/summary&gt;
      private void InitializeComponent()
      {
          this.SuspendLayout();
          // 
          // Form1
          // 
          this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
          this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
          this.ClientSize = new System.Drawing.Size(284, 262);
          this.Name = "Form1";
          this.Text = "Form1";
          this.Load += new System.EventHandler(this.Form1_Load);
          this.ResumeLayout(false);
  
      }
  
      #endregion
  }
  </code></pre>
  
  <p>This code is very simple extraction of my production code, so please do not tell me it is useless.</p>
  
  <p>If I would put all Application.Runs to one thread everything would be working and all three forms would be TopMost.
  If I run code as it is the first form is shown as TopMost and second and third does not. </p>
  
  <p>BUT: If I close form by red X Close button on shown form (thus Close method in timer's tick eventhandler is not called), next form will be shown as TopMost. It seems to me that there must be some difference between X Close button on form and Close method called in code. But I cannot figure out what is the difference and how to reach wanted behavior: closing by timer, all windows top most. </p>
  
  <p>Thanks for help</p>