title: VB.NET - form inside a panel resize
body: <p>I can't figure this out! I've researched docking, anchoring etc. but I'm yet to get it to correctly resize when the parent form resizes.</p>
  
  <p>Edit:</p>
  
  <p>Quick Overview: </p>
  
  <p>I have a main form with a menustrip docked to the top and a panel set to fill. I have links within the menustrip which open forms within the panel. See code below. I am struggling to get the form within the panel to resize with the panel.</p>
  
  <p>I've set the panel background to black and my form inside the panel to white. I can see the panel resizing with the form correctly. The form within the panel stays in its original position. If i start my app in maximized, then click on my menustrip sure enough the form within the panel resizes correctly. However, once it is maximized it doesn't shrink with the form like the panel container does.</p>
  
  <p><strong>I've deleted everything on my whole form, added 1 panel to it and set to fill then on form load do the following:</strong> </p>
  
  <pre><code>Dim f As New Contactdetails With {.TopLevel = False, .AutoSize = True}
      f.Dock = DockStyle.Fill
      Me.Panel2.Controls.Add(f)
      f.Show()
  </code></pre>
  
  <p><strong>This still doesn't work. When i maximize my main form, the form inside the panel does not resize but the panel does as i've changed it's background to monitor its change in size</strong></p>