title: How to create winform login dialog and keep looping
body: <p>Creating a login form that will then proceed to the main form if the credentials are correct.  Here is the basic pseudocode:</p>
  
  <pre><code>ShowLoginForm()
  
  if (DialogResult == OK)
    CheckCredentials();
    if (credentials == VALID)
      ShowMainForm();
    else
      LoopBackAndShowLoginFormAgain();  //repeat process...
  else
    CloseLoginForm();
  </code></pre>
  
  <p>However, I'm relatively new to WinForms and still figuring it out.  I'm trying to decide where to put my loop (Main() or somewhere in LoginForm).  Where should I make the check for credentials?  This is what I have so far:</p>
  
  <pre><code>static void Main()
  {
      Application.EnableVisualStyles();
      Application.SetCompatibleTextRenderingDefault(false);
  
      LoginForm loginForm = new LoginForm();
      if (loginForm.ShowDialog() == DialogResult.OK)
      {
          Application.Run(new AutoSignerForm());
      }
  }
  </code></pre>
  
  <p>I don't want to exit and open up a login form repeatedly (am looking for some efficiency here so I want to use the same login dialog).  Any pointers, tips, or ideas?</p>