title: Resize the multiple child forms in mdiparent automatically , panels and mdi C#
body: <p>I have mdiparent form which has menu and a panel on the left which includes treeview. the remaining space of the parent form can include multiple windows depending on the user how many he wants to open it. There is a splitter in the edge of the panel[ the one with treeview, on the left] which can increase or decrease the width of the panel and thereby increasing the area for the chart.</p>
  
  <p>I have tried using the mdilayout in splitter move event handler, but it does not work. </p>
  
  <p><a href="http://www.imageurlhost.com/images/x6pf89yp8x4cnm1hb4x_first.png" rel="nofollow noreferrer">first pic http://www.imageurlhost.com/images/x6pf89yp8x4cnm1hb4x_first.png</a></p>
  
  <p>The red vertical line is the splitter to increase/decrease the width of the panel on the left. 
  Initially, there is no space on the right side . opening a new child window fits well in the remaining space. </p>
  
  <p><a href="http://www.imageurlhost.com/images/b1pu4lztl7eel12b1ho_second.png" rel="nofollow noreferrer">2 http://www.imageurlhost.com/images/b1pu4lztl7eel12b1ho_second.png</a></p>
  
  <p>Splitter moved to the left. There is a space in the right, child form does not resize and fit to the area.</p>
  
  <p><a href="http://www.imageurlhost.com/images/f9ep8rd4fem5aynhc9z_third.png" rel="nofollow noreferrer">3 http://www.imageurlhost.com/images/f9ep8rd4fem5aynhc9z_third.png</a></p>
  
  <p>Splitter moved more to the left and space on the right keeps increasing. 
  If I open one more graph then  4 old and 1 new , total 5 forms fill perfectly fit well and space will be utilized. if I move the splitter again then space on the right side will be introduced again. </p>
  
  <p><a href="http://www.imageurlhost.com/images/e3fup4nrfb7aj7d13e5_four.png" rel="nofollow noreferrer">4 http://www.imageurlhost.com/images/e3fup4nrfb7aj7d13e5_four.png</a></p>
  
  <p>How can I make all the child forms to exactly fit the remaining space , each time the splitter moves?</p>
  
  <p>Code in Splitter move/mouseup event handler.</p>
  
  <pre><code>    this.LayoutMdi(MdiLayout.TileHorizontal);       
  </code></pre>
  
  <p>Child Forms [ the graph windows] have  </p>
  
  <pre><code>    this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
  </code></pre>
  
  <p>Parent Form [ which is in the picture] </p>
  
  <pre><code>    this.leftpanel.Dock = System.Windows.Forms.DockStyle.Left;
      this.leftpanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
      this.AutoSize = true;
  </code></pre>
  
  <p>If parent form is resized then resize event handler is also</p>
  
  <pre><code>    this.LayoutMdi(MdiLayout.TileHorizontal);
  </code></pre>
  
  <p>which seems to work well. if I maximize / custom size parent form, child forms resize accordingly . </p>
  
  <p>if I use same thing for , splitter eventhandlers, it does not work in the same way. </p>
  
  <p>Thanks,</p>