[Mono-bugs] [Bug 76302][Nor] New - Labels do not inherit the color from their containers.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Sep 30 19:16:37 EDT 2005


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 miguel at ximian.com.

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

--- shadow/76302	2005-09-30 19:16:37.000000000 -0400
+++ shadow/76302.tmp.2435	2005-09-30 19:16:37.000000000 -0400
@@ -0,0 +1,67 @@
+Bug#: 76302
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com                            
+ReportedBy: miguel at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Labels do not inherit the color from their containers.
+
+The following sample should render a window completely red, with a label
+whose background is red.
+
+Instead the background is gray.
+
+To compile: mcs file.cs -pkg:dotnet
+
+using System;
+using System.Windows.Forms;
+using System.Drawing;
+
+namespace MyFormProject
+{
+        class MainForm : System.Windows.Forms.Form
+        {
+                public MainForm()
+                {
+                        InitializeComponent();
+                }
+
+                void InitializeComponent() {
+                        Label l = new Label();
+                        l.Dock = System.Windows.Forms.DockStyle.Top;
+                        l.Location = new System.Drawing.Point(10, 10);
+                        l.Size = new System.Drawing.Size(627, 20);
+                        l.Text = "My background should be red";
+
+                        ClientSize = new System.Drawing.Size(627, 538);
+
+                        Panel p = new System.Windows.Forms.Panel ();
+                        p.Location = new Point (0,0);
+                        p.Dock = DockStyle.Top;
+                        p.Size = new Size (627, 538);
+                        p.BackColor = Color.FromArgb (255, 0, 0);
+
+                        p.Controls.Add (l);
+
+                        this.Controls.Add (p);
+
+                        this.ResumeLayout(false);
+                }
+
+                [STAThread]
+                public static void Main(string[] args)
+                {
+                        Application.Run(new MainForm());
+                }
+        }
+}


More information about the mono-bugs mailing list