title: Resizing a child form controls when resizing a Parent
body: <p>I'm trying to figure out a easy way to re-size my child form based on the size of the parent form. i.e The child form pops out of the parent form (FixedToolWindow).</p>
  
  <p>To do this presently i'm achieving this by having a OnParentResize event in my form child class. i.e</p>
  
  <pre><code>void OnParentResized(object sender, EventArgs e)
          {
              //Resize of the form shall be made only when the form is not minimized
              if (parent.WindowState != FormWindowState.Minimized)
              {
                  int iWidth = parent.Size.Width;
                  int iHeight = parent.Size.Height;
  
                  double dXFactor = (double)iWidth / (double)this.Width;
                  double dYFactor = (double)iHeight / (double)this.Height;
                  this.Scale(new SizeF((float)dXFactor, (float)dYFactor)); 
  
              }
          }
  </code></pre>
  
  <p>The line  this.Scale(new SizeF((float)dXFactor, (float)dYFactor)); 
  scales all the controls in my child form.</p>
  
  <p>When i use this i presume that whenever the parent form resizes, my child form does as well. Apparently i face a problem here, all the controls inside the child form are anchored to top-left. </p>
  
  <ol>
  <li><p>Initially all the controls in my child form are of normal size.</p></li>
  <li><p>Parent form is resized to make it small, the child form shrinks to the same factor as well.</p></li>
  <li><p>Now i increase the size of my parent form back to its original size. The size of the controls on the child form now increases by a higher ratio. And also the controls appear out of place.</p></li>
  </ol>
  
  <p>Can anyone suggest a better approach for such situations.</p>
  
  <p>Cheers</p>