* Control.cs: Apply patch from George to call parent.PerformLayout
when Visible is changed. [Fixes bugs #81118, 81718]
2007-05-23 Jonathan Pobst <monkey@jpobst.com>
* ControlTest.cs: Add test to show that setting a control's Visible
property causes it's parent to relayout.
svn path=/trunk/mcs/; revision=77865
+2007-05-23 Jonathan Pobst <monkey@jpobst.com>
+
+ * Control.cs: Apply patch from George to call parent.PerformLayout
+ when Visible is changed. [Fixes bugs #81118, 81718]
+
2007-05-23 Everaldo Canuto <ecanuto@novell.com>
* MainMenu.cs, MenuAPI.cs: Implement Collapse event for MainMenu (2.0).
}
set {
- SetVisibleCore(value);
+ if (this.is_visible != value) {
+ SetVisibleCore(value);
+
+ if (parent != null)
+ parent.PerformLayout (this, "Visible");
+ }
}
}
+2007-05-23 Jonathan Pobst <monkey@jpobst.com>
+
+ * ControlTest.cs: Add test to show that setting a control's Visible
+ property causes it's parent to relayout.
+
2007-05-23 Jonathan Pobst <monkey@jpobst.com>
* DefaultLayoutTest.cs: Add test for docking when parent has Padding.
}
+ [Test] // bug #81118, 81718
+ public void VisibleTriggersLayout ()
+ {
+ Form f = new Form ();
+ f.ShowInTaskbar = false;
+
+ Control c = new Control ();
+ c.Visible = false;
+
+ f.Controls.Add (c);
+
+ c.Dock = DockStyle.Fill;
+ c.Visible = true;
+
+ Assert.AreEqual (f.ClientSize.Width, c.Width, "L1");
+ }
}
[TestFixture]