[Mono-bugs] [Bug 82769][Nor] New - Setting ClientSize has different behavior in .NET and Mono, depending on order of other settings

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Sep 9 14:14:08 EDT 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 charlie at nunit.com.

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

--- shadow/82769	2007-09-09 14:14:08.000000000 -0400
+++ shadow/82769.tmp.12385	2007-09-09 14:14:08.000000000 -0400
@@ -0,0 +1,57 @@
+Bug#: 82769
+Product: Mono: Class Libraries
+Version: 1.2
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: charlie at nunit.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Setting ClientSize has different behavior in .NET and Mono, depending on order of other settings
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem: 
+
+The following code, when run under MS .NET 1.1, creates a 320 x 40 window
+with no border, title bar or other decoractions:
+
+	this.ClientSize = new System.Drawing.Size(320, 40);
+	this.ControlBox = false;
+	this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+	this.MaximizeBox = false;
+	this.MinimizeBox = false;
+
+When run under Mono, the window height is set as if it had a title bar and
+border - although none is displayed. This can be made to work correctly
+under mono, by modifying the code in one of two ways:
+
+#1	this.ClientSize = new System.Drawing.Size(320, 40);
+	this.Size = this.ClientSize;
+	this.ControlBox = false;
+	this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+	this.MaximizeBox = false;
+	this.MinimizeBox = false;
+
+#2	this.ControlBox = false;
+	this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+	this.MaximizeBox = false;
+	this.MinimizeBox = false;
+	this.ClientSize = new System.Drawing.Size(320, 40);
+
+It appears that .NET collects all the info and only determines the
+necessary window size at the point it needs to create it. Mono seems to
+be setting the size immediately, based on the ClientSize and the other
+settings at that point.
+
+This is a smidgen more important than it might seem, since the first code
+example is in the order that Visual Studio generates it.
+
+Charlie


More information about the mono-bugs mailing list