[Mono-bugs] [Bug 77475][Nor] New - Form.Windowstate.Maximized Size not available in Form.Load event.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sun Feb 5 13:08:16 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 kdaniels at usfamily.net.

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

--- shadow/77475	2006-02-05 13:08:16.000000000 -0500
+++ shadow/77475.tmp.18205	2006-02-05 13:08:16.000000000 -0500
@@ -0,0 +1,218 @@
+Bug#: 77475
+Product: Mono: Class Libraries
+Version: 1.1
+OS: 
+OS Details: Fedora Core 3
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: Windows.Forms
+AssignedTo: peter at novonyx.com                            
+ReportedBy: kdaniels at usfamily.net               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Form.Windowstate.Maximized Size not available in Form.Load event.
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+In .NET the maximized size of the form is available in the Load event when
+the form WindowState property is set to Maximized.
+
+example program:
+
+using System;
+
+using System.Drawing;
+
+using System.Windows.Forms;
+
+
+
+
+
+namespace WinFormSeqTest
+
+{
+
+	/// <summary>
+
+	/// Summary description for Form1.
+
+	/// </summary>
+
+	public class Form1 : System.Windows.Forms.Form
+
+	{
+
+		/// <summary>
+
+		/// Required designer variable.
+
+		/// </summary>
+
+		private System.ComponentModel.Container components = null;
+
+
+
+		public Form1()
+
+		{
+
+			//
+
+			// Required for Windows Form Designer support
+
+			//
+
+			InitializeComponent();
+
+
+
+			//
+
+			// TODO: Add any constructor code after InitializeComponent call
+
+			//
+
+			Size s = this.Size;
+
+			Console.WriteLine("Form Size after InitializeComponent = {0}, {1} ", 
+s.Width, s.Height);
+
+		}
+
+
+
+		/// <summary>
+
+		/// Clean up any resources being used.
+
+		/// </summary>
+
+		protected override void Dispose( bool disposing )
+
+		{
+
+			if( disposing )
+
+			{
+
+				if (components != null) 
+
+				{
+
+					components.Dispose();
+
+				}
+
+			}
+
+			base.Dispose( disposing );
+
+		}
+
+
+
+		#region Windows Form Designer generated code
+
+		/// <summary>
+
+		/// Required method for Designer support - do not modify
+
+		/// the contents of this method with the code editor.
+
+		/// </summary>
+
+		private void InitializeComponent()
+
+		{
+
+			// 
+
+			// Form1
+
+			// 
+
+			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
+
+			this.ClientSize = new System.Drawing.Size(292, 266);
+
+			this.Name = "Form1";
+
+			this.Text = "Form1";
+
+			this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
+
+			this.Load += new System.EventHandler(this.Form1_Load);
+
+
+
+		}
+
+		#endregion
+
+
+
+		/// <summary>
+
+		/// The main entry point for the application.
+
+		/// </summary>
+
+		[STAThread]
+
+		static void Main() 
+
+		{
+
+			Application.Run(new Form1());
+
+		}
+
+
+
+		private void Form1_Load(object sender, System.EventArgs e)
+
+		{
+
+			Size s=this.Size;
+
+			Console.WriteLine("Size at Form Load Time = {0}, {1}",s.Width,s.Height);
+
+		}
+
+	}
+
+}
+
+
+
+Steps to reproduce the problem:
+1. Compile and execute the above program.
+2. 
+3. 
+
+Actual Results:
+
+Mono System.Windows.Forms Assembly [Revision: 54007; built: 2005/12/6 14:35:24]
+Keyboard: United States keyboard layout (phantom key version)
+Gtk colorscheme read
+Form Size after InitializeComponent = 292, 266
+Size at Form Load Time = 292, 266
+
+
+Expected Results:
+
+Size at Form Load Tinme should show the size of the maximized form.
+
+How often does this happen? 
+Always
+
+Additional Information:
+
+Mono from SVN


More information about the mono-bugs mailing list