title: Set Focus to Form
body: <p>My <code>c#</code> <code>console application</code> opens a <code>login form</code> in which user enters login information, the problem is that when this <code>login form</code> opens <code>focus</code> is still set to <code>console application</code> even though <code>focus</code> should be set on <code>login form</code>. I've tried using both the <code>Focus()</code> &amp; <code>Activate()</code> functions with out any luck. Here is an example of how I've tried to set <code>focus</code> away from my <code>console application</code> and set <code>focus</code> to my  <code>login form</code>:</p>
  
  <pre><code>static void StartLoginForm()
  {
          Form frm = new Form();
          frm.ShowDialog();
          frm.Focus();//Didn't work for me
          frm.Activate();//Also didn't work for me
  }
  </code></pre>
  
  <p>What am i doing wrong? Any help would greatly be appreciated!
  <br><br><br>Thank you for your time.</p>