[Mono-bugs] [Bug 79294][Nor] Changed - [Control] Removing a control from ControlsCollection doesn't remove it from parent

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 8 14:34:10 EDT 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by unserkonig at gmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=79294

--- shadow/79294	2006-09-07 21:36:31.000000000 -0400
+++ shadow/79294.tmp.12394	2006-09-08 14:34:10.000000000 -0400
@@ -38,6 +38,40 @@
 // value.Hide ();
 
 Uncommenting this line fixed my case of this issue.
 
 ------- Additional Comments From toshok at ximian.com  2006-09-07 21:36 -------
 hm, did you forget to attach the sample?
+
+------- Additional Comments From unserkonig at gmail.com  2006-09-08 14:34 -------
+using System;
+using System.Windows.Forms;
+using System.Drawing;
+
+public class TestForm : Form
+{
+	Label l;
+
+	static void Main ()
+	{
+		Application.Run (new TestForm ());
+	}
+
+	public TestForm ()
+	{
+		l = new Label ();
+		l.Text = "Hi";
+		l.Location = new Point (5, 5);
+		l.Parent = this;
+
+		Button b = new Button ();
+		b.Text = "Click";
+		b.Location = new Point (5, 35);
+		b.Parent = this;
+		b.Click += new EventHandler (ButtonClick);
+	}
+
+	void ButtonClick (object o, EventArgs a)
+	{
+		l.Parent = null;
+	}
+}


More information about the mono-bugs mailing list