[Mono-bugs] [Bug 80801][Cos] New - Label.PreferredHeight returns incorrect value after calling Application.SetCompatibleTextRenderingDefault

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Feb 11 19:55:16 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 georgegiolfan at yahoo.com.

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

--- shadow/80801	2007-02-11 19:55:16.000000000 -0500
+++ shadow/80801.tmp.28066	2007-02-11 19:55:16.000000000 -0500
@@ -0,0 +1,39 @@
+Bug#: 80801
+Product: Mono: Class Libraries
+Version: 1.2
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Cosmetic
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: georgegiolfan at yahoo.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Label.PreferredHeight returns incorrect value after calling Application.SetCompatibleTextRenderingDefault
+
+Steps to reproduce the problem:
+using System.Diagnostics;
+using System.Windows.Forms;
+class Test {
+    static void Main() {
+        Application.SetCompatibleTextRenderingDefault(false);
+        Label l = new Label();
+        Debug.Assert(l.PreferredHeight == l.Font.Height);
+        l.BorderStyle = BorderStyle.Fixed3D;
+        Debug.Assert(l.PreferredHeight == l.Font.Height);
+        l.BorderStyle = BorderStyle.FixedSingle;
+        Debug.Assert(l.PreferredHeight == l.Font.Height);
+    }
+}
+
+Additional Information:
+Adding
+#if NET_2_0
+            if (use_compatible_text_rendering)
+#endif
+in Label.CalcPreferredHeight before the switch block seems to fix it.


More information about the mono-bugs mailing list