[Mono-bugs] [Bug 78718][Nor] Changed - Form: Setting Form.MdiParent to null when the container is not null crashes.
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Sat Jul 1 00:25:15 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=78718
--- shadow/78718 2006-06-30 20:03:08.000000000 -0400
+++ shadow/78718.tmp.30810 2006-07-01 00:25:15.000000000 -0400
@@ -41,6 +41,47 @@
------- Additional Comments From jackson at ximian.com 2006-06-30 20:03 -------
Could you attach a sample so I can try?
Thanks,
Jackson
+
+------- Additional Comments From unserkonig at gmail.com 2006-07-01 00:25 -------
+Sorry, I forgot to add the sample.
+
+//Sample
+using System;
+using System.Windows.Forms;
+using System.Drawing;
+
+public class Test
+{
+ static void Main ()
+ {
+ TestForm form = new TestForm ();
+ Application.Run (form);
+ }
+}
+
+public class TestForm : Form
+{
+ public TestForm ()
+ {
+ IsMdiContainer = true;
+
+ // Add an Mdi component
+ Form child_form = new Form ();
+ child_form.MdiParent = this;
+ child_form.Show ();
+
+ Button button = new Button ();
+ button.Text = "Click me";
+ button.Location = new Point (5, 5);
+ button.Size = new Size (90, 40);
+ button.Parent = child_form;
+ button.Click += delegate (object o, EventArgs args) {
+ child_form.MdiParent = (child_form.MdiParent
+== null ? this : null);
+ };
+ }
+}
+
More information about the mono-bugs
mailing list