All pastes #332212 Raw Edit

Anonymous

public text v1 · immutable
#332212 ·published 2007-01-29 20:33 UTC
rendered paste body
Index: DefaultLayout.cs
===================================================================
--- DefaultLayout.cs	(revision 71868)
+++ DefaultLayout.cs	(working copy)
@@ -36,7 +36,8 @@
 		void LayoutDockedChildren (Control parent, Control[] controls)
 		{
 			Rectangle space = parent.DisplayRectangle;
-
+			MdiClient mdi = null;
+			
 			// Deal with docking; go through in reverse, MS docs say that lowest Z-order is closest to edge
 			for (int i = controls.Length - 1; i >= 0; i--) {
 				Control child = controls[i];
@@ -45,6 +46,12 @@
 				    || child.ControlLayoutType == Control.LayoutType.Anchor)
 					continue;
 
+				// MdiClient never fills the whole area like other controls, have to do it later
+				if (child is MdiClient) {
+					mdi = (MdiClient)child;
+					continue;
+				}
+				
 				switch (child.Dock) {
 				case DockStyle.None:
 					// Do nothing
@@ -77,6 +84,10 @@
 					break;
 				}
 			}
+
+			// MdiClient gets whatever space is left
+			if (mdi != null)
+				mdi.SetImplicitBounds (space.Left, space.Top, space.Width, space.Height);
 		}
 
 		void LayoutAnchoredChildren (Control parent, Control[] controls)