Explorar el Código

2007-03-12 Jonathan Pobst <[email protected]>

	* Form.cs: Don't call RecreateHandle when we change the MinimizeBox
	or the MaximizeBox properties.  [Part of bug #80640]

2007-03-12  Jonathan Pobst  <[email protected]>

	* FormTest.cs: Add a test showing we do not recreate the handle when
	MinimizeBox or MaximizeBox is changed. [Part of bug #80640]

svn path=/trunk/mcs/; revision=74140
Jonathan Pobst hace 19 años
padre
commit
f12277feb4

+ 5 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,8 @@
+2007-03-12  Jonathan Pobst  <[email protected]>
+
+	* Form.cs: Don't call RecreateHandle when we change the MinimizeBox
+	or the MaximizeBox properties.  [Part of bug #80640]
+
 2007-03-12  Everaldo Canuto  <[email protected]>
 
 	* LinkLabel.cs: When calculate pieces make LinkArea empty if theres

+ 0 - 6
mcs/class/Managed.Windows.Forms/System.Windows.Forms/Form.cs

@@ -627,9 +627,6 @@ namespace System.Windows.Forms {
 			set {
 				if (maximize_box != value) {
 					maximize_box = value;
-					if (IsHandleCreated) {
-						RecreateHandle();
-					}
 					UpdateStyles();
 				}
 			}
@@ -814,9 +811,6 @@ namespace System.Windows.Forms {
 			set {
 				if (minimize_box != value) {
 					minimize_box = value;
-					if (IsHandleCreated) {
-						RecreateHandle();
-					}
 					UpdateStyles();
 				}
 			}

+ 5 - 0
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/ChangeLog

@@ -1,3 +1,8 @@
+2007-03-12  Jonathan Pobst  <[email protected]>
+
+	* FormTest.cs: Add a test showing we do not recreate the handle when
+	MinimizeBox or MaximizeBox is changed. [Part of bug #80640]
+
 2007-03-12  Jonathan Pobst  <[email protected]>
 
 	* ControlTest.cs: Add test for bug #80621.

+ 35 - 0
mcs/class/Managed.Windows.Forms/Test/System.Windows.Forms/FormTest.cs

@@ -1114,6 +1114,41 @@ namespace MonoTests.System.Windows.Forms
 		}
 #endif
 
+		int create = 0;
+		int destroy = 0;
+		
+		[Test]
+		[NUnit.Framework.Category ("Current")]
+		public void PropertyMinimizeMaximizeBoxHandle ()
+		{
+			Form f = new Form ();
+			f.ShowInTaskbar = false;
+			f.Show ();
+
+			f.HandleCreated += new EventHandler (f_HandleCreated);
+			f.HandleDestroyed += new EventHandler (f_HandleDestroyed);
+			
+			f.MinimizeBox = false;
+			f.MaximizeBox = false;
+			f.MinimizeBox = true;
+			f.MaximizeBox = true;
+			
+			Assert.AreEqual (0, create, "A1");
+			Assert.AreEqual (0, destroy, "A2");
+			
+			f.Dispose ();
+		}
+
+		void f_HandleDestroyed (object sender, EventArgs e)
+		{
+			destroy++;
+		}
+
+		void f_HandleCreated (object sender, EventArgs e)
+		{
+			create++;
+		}
+		
 		private bool RunningOnUnix {
 			get {
 				// check for Unix platforms - see FAQ for more details