[Mono-bugs] [Bug 80815][Wis] New - TextBox.BackColor not drawn correctly

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Feb 12 18:08:01 EST 2007


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 fmoraes at nc.rr.com.

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

--- shadow/80815	2007-02-12 18:08:01.000000000 -0500
+++ shadow/80815.tmp.14007	2007-02-12 18:08:01.000000000 -0500
@@ -0,0 +1,83 @@
+Bug#: 80815
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: Windows XP SP 2 and Linux RHEL 4
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: fmoraes at nc.rr.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: TextBox.BackColor not drawn correctly
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+TextBox.BackColor is not being drawn at all. Tested with Mono 1.2.3 on both
+Windows XP SP 2 and Linux RHEL 4.
+
+Steps to reproduce the problem:
+1. Compile attached Test.cs with mcs Test.cs -r:System.Drawing
+-r:System.Windows.Forms
+2. Run Test.exe with both Mono and .Net 2.0
+
+Actual Results:
+
+On Mono, the BackColor of the TextBox is always white.
+
+Expected Results:
+
+On .NET 2.0, the BackColor will change between Red and Green depending on
+the length of the string in the text box.
+
+How often does this happen? 
+
+Always.
+
+Additional Information:
+
+using System;
+using System.Drawing;
+using System.Windows.Forms;
+
+public class Test : Form
+{
+	private TextBox tb1;
+
+	public static void Main ()
+	{
+		Application.Run (new Test ());
+	}
+
+	public Test ()
+	{
+		tb1 = new TextBox ();
+		tb1.TextChanged += new System.EventHandler(this.tb1TextChanged);
+		Controls.Add(tb1);
+	}
+
+	void tb1TextChanged(object sender, System.EventArgs e)
+	{
+		string word = tb1.Text.ToLower();
+		if(word.Length > 0) {
+			bool res = (word.Length & 1) != 0;
+			if(res) {
+				tb1.BackColor = Color.LightGreen;
+				tb1.ForeColor = Color.Black;
+			} else {
+				tb1.BackColor = Color.Crimson;
+				tb1.ForeColor = Color.White;
+			}
+		} else {
+			tb1.BackColor = SystemColors.Window;
+			tb1.ForeColor = DefaultForeColor;
+		}
+	}
+}


More information about the mono-bugs mailing list