[Mono-bugs] [Bug 80207][Nor] New - ListView ColumnHeader has wrong height when Width is -1 or -2

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Dec 9 14:17:25 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=80207

--- shadow/80207	2006-12-09 14:17:25.000000000 -0500
+++ shadow/80207.tmp.16977	2006-12-09 14:17:25.000000000 -0500
@@ -0,0 +1,59 @@
+Bug#: 80207
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Windows XP
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: toshok at ximian.com                            
+ReportedBy: georgegiolfan at yahoo.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: ListView ColumnHeader has wrong height when Width is -1 or -2
+
+Description of Problem:
+ListView ColumnHeader has wrong height when Width is -1 or -2.
+
+Steps to reproduce the problem:
+1. Compile and run the following program.
+using System.Windows.Forms;
+class TestForm : Form {
+    static void Main() {
+        Application.Run(new TestForm());
+    }
+    public TestForm() {
+        Controls.Add(new TestListView());
+    }
+    class TestListView : ListView {
+        public TestListView() {
+            View = View.Details;
+            ColumnHeader TestColumnHeader = new ColumnHeader();
+            // This line triggers the bug.
+            TestColumnHeader.Width = -2;
+            Columns.AddRange(new ColumnHeader[] { TestColumnHeader });
+        }
+    }
+}
+2. Resize the column header to see that it changes height.
+
+Actual Results:
+Column header is displayed with a smaller height initially, and when 
+resized its height changes to normal.
+
+Expected Results:
+The column header always has a correct size.
+
+How often does this happen? 
+Always.
+
+Additional Information:
+I think the height is computed incorrectly in ListView.GetChildColumnSize 
+(int index), or ColumnHeader.CalcColumnHeader should use some other way to 
+set the height. A quick fix could be to simply use 
+this.column_rect.Height = ThemeEngine.Current.DefaultFont.Height + 5;
+in all cases, if this does not affect anything else.


More information about the mono-bugs mailing list