title: Form not refreshing after ShowDialog (Compact Framework)
body: <p>I'm having a weird issue with form painting in the Compact Framework. I have a login dialog that is basically a small form that is opened on top of another using ShowDialog. When a card is swiped, the login dialog is supposed to close, then some login tasks are performed and then the form behind it should be activated. The problem is that the form behind the login dialog is not being refreshed and so the login dialog will not be removed until after the form behind is refreshed by some user action. This is probably due to the heavy processing that goes on in the login tasks part, but I've not found a way to solve this.</p>
  
  <p>Basically, I want a way to force the application to close the dialog and paint everything again, before performing the heavy login tasks. I've tried numerous refresh methods without any luck:</p>
  
  <pre><code>Form loginDialog = new Form();
  DialogResult result = loginDialog.ShowDialog();
  loginDialog.Dispose();
  
  //I've tried everything at this point to get the form to refresh before performing
  //login tasks
  this.Refresh();
  this.Invalidate();
  Application.DoEvents();
  
  
  PerformHeavyLoginTasks();
  </code></pre>
  
  <p>Does anyone know what could be going wrong? Thanks</p>