title: Form changes size between constructor exit and begining of Load C#
body: <p>I am rather baffled at the moment, I have a form which I show as a dialog (although non dialog is the same) in response to a menu item click.</p>
  
  <pre><code>    var createUser = new FrmCreateUser();
      createUser.ShowDialog();
  </code></pre>
  
  <p>Somewhere between the constructor exiting, and when the load event is fired the size is being changed.</p>
  
  <p>I have overloaded WndProc in the 'parent' form, although it just falls though to the base implementation so I find it hard to believe that's the cause.</p>
  
  <pre><code>    protected override void WndProc(ref Message m)
      {
          if (m.Msg == (int)WindowsMessages.WM_SYSCOMMAND)
          {
  
              if (m.WParam.ToInt32() == (int)WindowsMessages.SC_MINIMIZE)
              {
                  foreach (Form f in Application.OpenForms)
                      if (f != this)
                          f.Hide();
  
              }
              else if (m.WParam.ToInt32() == (int)WindowsMessages.SC_RESTORE)
              {
                  foreach (Form f in Application.OpenForms)
                      if (f != this &amp;&amp; f.GetType() != typeof (Controls.DockLocation) )
                          f.Show();
              }
          }
  
          base.WndProc(ref m);
      }
  </code></pre>
  
  <p>I can restore the size to what is should be in the load event handler, but I remain confused as to the cause.</p>
  
  <pre><code>    private void FrmCreateUser_Load(object sender, EventArgs e)
      {
          Size = new Size(RestoreBounds.Width, RestoreBounds.Height);
      }
  </code></pre>
  
  <p>If anyone can shed some light on this it would be much appreciated.</p>
  
  <hr>
  
  <p><strong>Edit</strong></p>
  
  <p>Removing the WndProc override has no effect.   </p>
  
  <p>SizeChanged is only invoked once (inside the <code>createUser.ShowDialog()</code> call) which occurs before <code>OnHandleCreated(EventArgs e)</code> is called.</p>
  
  <p><strong>Edit 2</strong></p>
  
  <p>Here are some pictures to show the effect.</p>
  
  <p>designer:</p>
  
  <p><a href="http://www.free.nodespot.com/designer.jpg" rel="nofollow noreferrer">Designer http://www.free.nodespot.com/designer.jpg</a></p>
  
  <p>runtime:
  <a href="http://www.free.nodespot.com/runtime.jpg" rel="nofollow noreferrer">Runtime http://www.free.nodespot.com/runtime.jpg</a></p>