title: My splash screen won’t hide or close correctly
body: <p>I am making a program that connects to sql server and manage data on it. So, I made a form splash screen to check if the server is running and load some needed data from it like settings.</p>
  <p>The problem is the form don’t disappear when my main form loads. I have tried:</p>
  <pre class="lang-cs prettyprint-override"><code>this.Hide();
  </code></pre>
  <p>And it doesn’t work. The form stays shown and if I used</p>
  <pre><code>private void loading_Load( object sender , EventArgs e )
  {
     // some stuff to do 
     start();
  }
  
  private void start()
  {
      main form = new main( );
      form.Show( );
      this.Close( );
  }
  </code></pre>
  <p>An error shows in line</p>
  <pre class="lang-cs prettyprint-override"><code>static void Main( )
  {
      Application.EnableVisualStyles( );
      Application.SetCompatibleTextRenderingDefault( false );
      Application.Run( new loadingfrm( ) ); // this line gets error
  }
  </code></pre>
  <p>in <code>program.cs</code> file.
  It says trying to use disposed resource and the program closes completely without showing any form .</p>