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 [EMAIL PROTECTED] http://bugzilla.ximian.com/show_bug.cgi?id=78804 --- shadow/78804 2006-07-10 08:46:14.000000000 -0400 +++ shadow/78804.tmp.16649 2006-07-10 08:46:15.000000000 -0400 @@ -0,0 +1,63 @@ +Bug#: 78804 +Product: Mono: Class Libraries +Version: 1.1 +OS: +OS Details: Windows XP +Status: NEW +Resolution: +Severity: +Priority: Major +Component: Windows.Forms +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Form.Controls.Clear() doesn't work + +Description of Problem: +Using mono 1.1.16, Windows XP SP1, the following code does not work (and it +does using MS.NET). Apparently Form.Controls.Clear() does not do anything. +When you call the Clear() method right after Add(), it works, but when it's +called from a button's Click event, it doesn't. + +Reproduce code: +using System; +using System.Collections.Generic; +using System.Windows.Forms; +using System.Drawing; + +namespace MonoTest10 +{ + class Form1 : Form + { + static void Main() + { + Application.Run(new Form1()); + } + + public Form1() + { + Label L = new Label(); + L.Text = "hello"; + this.Controls.Add(L); + + Button B = new Button(); + B.Top = 150; + B.Click += new EventHandler(B_Click); + this.Controls.Add(B); + } + + void B_Click(object sender, EventArgs e) + { + this.Controls.Clear(); + } + } +} + +Actual Results: +When clicking the button, nothing happens. + +Expected Results: +Both the button and the label should disappear. _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
