From 9ad05afd241dda180e2f1eb3852a4920fff4423e Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Fri, 29 Dec 2006 06:29:07 +0000 Subject: [PATCH] * Control.cs: fix a couple of place where we were creating handles more aggressively than we should be. Fixes ControlRefresh unit tests. 2006-12-28 Chris Toshok svn path=/trunk/mcs/; revision=70195 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 6 ++++++ .../Managed.Windows.Forms/System.Windows.Forms/Control.cs | 15 +++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index c740297f05c..c9eb155bdb9 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,5 +1,11 @@ 2006-12-28 Chris Toshok + * Control.cs: fix a couple of place where we were creating handles + more aggressively than we should be. Fixes ControlRefresh unit + tests. + +2006-12-28 Chris Toshok + * Control.cs: contrary to what the comment said, Control.Dock does not supercede Control.Anchor - the last one you assign to decides the layout behavior. so we need to keep track of which was the diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs index 7b98e87b747..582a4131a7a 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/Control.cs @@ -1618,7 +1618,7 @@ namespace System.Windows.Forms OnRightToLeftChanged(EventArgs.Empty); } - if ((new_parent != null) && new_parent.Created && !Created) { + if ((new_parent != null) && new_parent.Created && is_visible && !Created) { CreateControl(); } @@ -3081,7 +3081,8 @@ namespace System.Windows.Forms return false; } - public void CreateControl() { + public void CreateControl () + { if (is_disposed) { throw new ObjectDisposedException(GetType().FullName.ToString()); } @@ -3099,7 +3100,8 @@ namespace System.Windows.Forms Control [] controls = child_controls.GetAllControls (); for (int i=0; i