title: Close form after 10 seconds
body: <p>I have a windows form application that will open other forms, but will only display the forms for a few seconds (user configurable).  I would normally do something like threading.thread.sleep(n), however when doing this the forms controls do not load only the white background shows, and I have also been reading that this isnt the best practice for what I am after as user input will not be actioned until the thread wakes up.</p>
  
  <p>I have come across people using System.Timers.Timer(n), but I am struggling to get this to work for me, the form will only open and close straight away (you can only see a flash as the form opens then closes).</p>
  
  <p>The code that I am using is:</p>
  
  <pre><code>Private Shared tmr As New System.Timers.Timer    
  aForm.Show()
  tmr = New System.Timers.Timer(aSleep * 60 * 60)
  tmr.Enabled = True
  
  aForm.Close()
  </code></pre>
  
  <p>This is all contained within a Private sub that passes the form and the defined run time.</p>
  
  <p>My intention is to have the main application running from the task bar, which then calls one of the forms that will display for a defined period of time, close the form, then call another one of the forms.</p>
  
  <p>Is any able to point me in the right direction for why the form opens then closes without seeing through the defined run time (I have been testing with 10 seconds), or is there a better way of doing what I am seeking?</p>
  
  <p>Your help is greatly appreciated.</p>
  
  <p>Matt</p>