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=82667 --- shadow/82667 2007-09-02 22:45:13.000000000 -0400 +++ shadow/82667.tmp.16555 2007-09-02 22:45:13.000000000 -0400 @@ -0,0 +1,87 @@ +Bug#: 82667 +Product: Mono: Class Libraries +Version: unspecified +OS: +OS Details: +Status: NEW +Resolution: +Severity: +Priority: Normal +Component: Windows.Forms +AssignedTo: [EMAIL PROTECTED] +ReportedBy: [EMAIL PROTECTED] +QAContact: [EMAIL PROTECTED] +TargetMilestone: --- +URL: +Cc: +Summary: Control: Making visible a child control should not hide children controls in front (z order) + +Please fill in this template when reporting a bug, unless you know what you +are doing. +Description of Problem: + +Making visible a child control (in Control.Controls) that was previously +non-visible should not hide other children controls that have lower indexes +in ControlCollection (or, in other words, that are in the front in the Z +order). + +Instead, it should be visible but behind the other controls (as Z order +imposes). + +Steps to reproduce the problem: +1. Compile the attached sample. +2. Run it and then press the "Make Green Visible". + +Actual Results: +The label with text "Green" is visible and the "Orange" label is hidden +(it's sent to the back it seems). + +Expected Results: +"Green" should be visible now, but behind "Orange" because orange has a +lower index in Control.ControlCollection + +using System; +using System.Windows.Forms; +using System.Drawing; + +public class Test +{ + public static void Main () + { + Application.Run (new TestForm ()); + } +} + +public class TestForm : Form +{ + Label l1, l2; + Button b; + + public TestForm () + { + l1 = new Label (); + l1.Text = "Orange"; + l1.Location = new Point (10, 10); + l1.BackColor = Color.Orange; + + l2 = new Label (); + l2.Text = "Green"; + l2.Visible = false; + l2.Location = new Point (0, 0); + l2.Size = new Size (180, 100); + l2.BackColor = Color.Green; + + Button b = new Button (); + b.Text = "Make Green visible"; + b.Location = new Point (l2.Right + 5, 5); + b.Size = new Size (100, 40); + b.Click += Button1Handler; + + Controls.AddRange (new Control [] {l1, l2, b}); + } + + void Button1Handler (object o, EventArgs args) + { + l2.Visible = true; + } +} _______________________________________________ mono-bugs maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-bugs
