[Mono-bugs] [Bug 70951][Nor] New - Docking does not work properly in some situations
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Mon, 3 Jan 2005 08:50:04 -0500 (EST)
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 jordi@ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=70951
--- shadow/70951 2005-01-03 08:50:04.000000000 -0500
+++ shadow/70951.tmp.12190 2005-01-03 08:50:04.000000000 -0500
@@ -0,0 +1,91 @@
+Bug#: 70951
+Product: Mono: Class Libraries
+Version: 1.1
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: peter@novonyx.com
+ReportedBy: jordi@ximian.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Docking does not work properly in some situations
+
+In some situations docking does not work properly. In this example, a
+listbox control uses DockStyle.Top. If you override the SizeChanged event
+you get a Width of 846 that is impossible because the form is 544x493. With
+Microsoft, the last size event is Width=524,Height=26, that is correct.
+
+Attached the sample to reproduce it.
+
+* With Microsoft .Net:
+
+Size changed to {X=0,Y=0,Width=80,Height=26}
+Size changed to {X=0,Y=0,Width=96,Height=26}
+Size changed to {X=0,Y=0,Width=80,Height=26}
+Size changed to {X=0,Y=0,Width=524,Height=26}
+
+* With Mono:
+
+Size changed to {X=0,Y=0,Width=846,Height=30}
+
+using System;
+using System.Windows.Forms;
+
+namespace MyFormProject
+{
+ class MainForm : System.Windows.Forms.Form
+ {
+ private System.Windows.Forms.ListBox listBox7;
+
+
+ public MainForm()
+ {
+ InitializeComponent();
+ }
+
+ void InitializeComponent() {
+
+ this.listBox7 = new System.Windows.Forms.ListBox();
+
+ this.SuspendLayout();
+
+ this.listBox7.Dock = System.Windows.Forms.DockStyle.Top;
+ this.listBox7.Items.AddRange(new object[] {
+ "A normal listbox - Dock=Top",
+ "http://www.go-mono.com",
+ "http://www.got-mono.com",
+ "http://quicksql.sf.net"});
+ this.listBox7.Location = new System.Drawing.Point(0, 0);
+ this.listBox7.Name = "listBox7";
+ this.listBox7.Size = new System.Drawing.Size(100, 30);
+ this.listBox7.TabIndex = 6;
+ this.listBox7.SizeChanged += new System.EventHandler (OnResize);
+
+ //
+ // MainForm
+ //
+ this.ClientSize = new System.Drawing.Size(544, 493);
+ this.Controls.AddRange(new System.Windows.Forms.Control[] {
+ this.listBox7,});
+ this.Text = "SWF-Listboxes";
+ this.ResumeLayout(false);
+ }
+
+ private void OnResize (object sender, System.EventArgs e)
+ {
+ Console.WriteLine ("Size changed to {0}", listBox7.ClientRectangle);
+ }
+
+ [STAThread]
+ public static void Main(string[] args)
+ {
+ Application.Run(new MainForm());
+ }
+ }
+}