[Mono-bugs] [Bug 80301][Min] New - TextBoxBase.PrefferedHeight returns incorrect values
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Mon Dec 18 07:54:30 EST 2006
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=80301
--- shadow/80301 2006-12-18 07:54:30.000000000 -0500
+++ shadow/80301.tmp.9217 2006-12-18 07:54:30.000000000 -0500
@@ -0,0 +1,52 @@
+Bug#: 80301
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Windows XP
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Minor
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com
+ReportedBy: georgegiolfan at yahoo.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: TextBoxBase.PrefferedHeight returns incorrect values
+
+Description of Problem:
+TextBoxBase.PrefferedHeight returns incorrect values.
+
+Steps to reproduce the problem:
+Compile and run the following program,
+using System.Windows.Forms;
+public class TestForm : Form {
+ static void Main() {
+ TextBox t = new TextBox();
+ t.BorderStyle = BorderStyle.None;
+ MessageBox.Show(t.PreferredHeight.ToString());
+ t.BorderStyle = BorderStyle.FixedSingle;
+ MessageBox.Show(t.PreferredHeight.ToString());
+ t.BorderStyle = BorderStyle.Fixed3D;
+ MessageBox.Show(t.PreferredHeight.ToString());
+ }
+}
+
+Actual Results:
+20, 22, 24
+
+Expected Results:
+13, 20, 20
+
+How often does this happen?
+Always on the SVN version. It works better on v. 1.2.2.1 (returns the same
+value as the Microsoft implementation when the border style and font size
+have the default values).
+
+Additional Information:
+The implementation changed in r69115. Here is an implementation that would
+work on Windows when the font size is 13.
+return Font.Height + (border_style == BorderStyle.None ? 0 : 7);
+The difference between the font size and preffered height is not constant.
More information about the mono-bugs
mailing list